Skip to content

Commit 3cd7465

Browse files
committed
Marked unused event handlers as [Obsolete]
For a decade, we've continued to maintain the `DeleteEvent`, `MoveEvent`, and `RenameEvent` on `ITopicRepository` and its predecessors. No implementation has actually ever actually used them, however. There may be a good use case for these (I can imagine several) but the fact that we have never ended up utilizing them makes their value unconvincing. Further, they're not currently covered by unit tests, which means we're not confident they even work as expected. Ultimately, if we want to implement events for a project, we likely want far more extensive event coverage (e.g., for other services, for before and after states, &c.) and should revisit this as a more deliberate effort.
1 parent 41598c5 commit 3cd7465

5 files changed

Lines changed: 14 additions & 1 deletion

File tree

OnTopic/Repositories/DeleteEventArgs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace OnTopic.Repositories {
1313
/// <summary>
1414
/// The DeleteEventArgs class defines an event argument type specific to deletion events
1515
/// </summary>
16+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
1617
public class DeleteEventArgs : EventArgs {
1718

1819
/*==========================================================================================================================

OnTopic/Repositories/ITopicRepository.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@ public interface ITopicRepository {
2222
/// <summary>
2323
/// Instantiates the <see cref="DeleteEventArgs"/> event handler.
2424
/// </summary>
25+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
2526
event EventHandler<DeleteEventArgs> DeleteEvent;
2627

2728
/// <summary>
2829
/// Instantiates the <see cref="MoveEventArgs"/> event handler.
2930
/// </summary>
31+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
3032
event EventHandler<MoveEventArgs> MoveEvent;
3133

3234
/// <summary>
3335
/// Instantiates the <see cref="RenameEventArgs"/> event handler.
3436
/// </summary>
37+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
3538
event EventHandler<RenameEventArgs> RenameEvent;
3639

3740
/*==========================================================================================================================

OnTopic/Repositories/MoveEventArgs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace OnTopic.Repositories {
1717
/// <remarks>
1818
/// Allows tracking of the source and destination topics.
1919
/// </remarks>
20+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
2021
public class MoveEventArgs : EventArgs {
2122

2223
/*==========================================================================================================================

OnTopic/Repositories/RenameEventArgs.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace OnTopic.Repositories {
1313
/// <summary>
1414
/// The RenameEventArgs object defines an event argument type specific to rename events.
1515
/// </summary>
16+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
1617
public class RenameEventArgs : EventArgs {
1718

1819
/*==========================================================================================================================

OnTopic/Repositories/TopicRepositoryBase.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using System.Linq;
1616
using OnTopic.Collections;
1717

18+
#pragma warning disable CS0618 // Type or member is obsolete; used to hide known deprecation of events until v5.0.0
19+
1820
namespace OnTopic.Repositories {
1921

2022
/*============================================================================================================================
@@ -34,12 +36,15 @@ public abstract class TopicRepositoryBase : ITopicRepository {
3436
| EVENT HANDLERS
3537
\-------------------------------------------------------------------------------------------------------------------------*/
3638
/// <inheritdoc />
39+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
3740
public event EventHandler<DeleteEventArgs>? DeleteEvent;
3841

3942
/// <inheritdoc />
43+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
4044
public event EventHandler<MoveEventArgs>? MoveEvent;
4145

4246
/// <inheritdoc />
47+
[Obsolete("The TopicRepository events will be removed in OnTopic Library 5.0.", false)]
4348
public event EventHandler<RenameEventArgs>? RenameEvent;
4449

4550
/*==========================================================================================================================
@@ -434,4 +439,6 @@ protected IEnumerable<AttributeDescriptor> GetUnmatchedAttributes(Topic topic) {
434439
}
435440

436441
} //Class
437-
} //Namespace
442+
} //Namespace
443+
444+
#pragma warning restore CS0618 // Type or member is obsolete

0 commit comments

Comments
 (0)