Skip to content

Commit bad250b

Browse files
committed
Reintroduced events as [Obsolete]
The `DeleteEvent`, `MoveEvent`, and `RenameEvent` were renamed to, respectively, `TopicDeleted`, `TopicMoved, and `TopicRenamed`. This provides instructions to callers of the original class name. Unfortunately, an `[Obsolete[]` member of an interface still needs to be implemented on each implementation of that interface. As such, we won't want to persist these for long after the migration to OnTopic 5.0.0. That said, fortunately, we expect all implementations of `ITopicRepository` to implement `ObservableTopicRepository` as a base class and, therefore, can implement these in that one location in order to cover all derived types (e.g., `SqlTopicRepository`, `CachedTopicRepository`, &c.)
1 parent a50da2a commit bad250b

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

OnTopic/Repositories/ITopicRepository.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ public interface ITopicRepository {
5656
/// </summary>
5757
event EventHandler<TopicRenameEventArgs> TopicRenamed;
5858

59+
/// <inheritdoc cref="TopicDeleted"/>
60+
[Obsolete("The DeleteEvent has been renamed to TopicDeleted")]
61+
event EventHandler<DeleteEventArgs> DeleteEvent;
62+
63+
/// <inheritdoc cref="TopicMoved"/>
64+
[Obsolete("The MoveEvent has been renamed to TopicMoved")]
65+
event EventHandler<DeleteEventArgs> MoveEvent;
66+
67+
/// <inheritdoc cref="TopicRenamed"/>
68+
[Obsolete("The RenameEvent has been renamed to TopicRenamed")]
69+
event EventHandler<RenameEventArgs> RenameEvent;
70+
5971
/*==========================================================================================================================
6072
| GET CONTENT TYPE DESCRIPTORS
6173
\-------------------------------------------------------------------------------------------------------------------------*/

OnTopic/Repositories/ObservableTopicRepository.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ public event EventHandler<TopicRenameEventArgs>? TopicRenamed {
6565
remove => _topicRenamed -= value;
6666
}
6767

68+
/// <inheritdoc cref="TopicDeleted"/>
69+
[Obsolete("The DeleteEvent has been renamed to TopicDeleted")]
70+
public event EventHandler<DeleteEventArgs>? DeleteEvent;
71+
72+
/// <inheritdoc cref="TopicMoved"/>
73+
[Obsolete("The MoveEvent has been renamed to TopicMoved")]
74+
public event EventHandler<DeleteEventArgs>? MoveEvent;
75+
76+
/// <inheritdoc cref="TopicRenamed"/>
77+
[Obsolete("The RenameEvent has been renamed to TopicRenamed")]
78+
public event EventHandler<RenameEventArgs>? RenameEvent;
79+
6880
/*==========================================================================================================================
6981
| ON TOPIC LOADED
7082
\-------------------------------------------------------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)