Interface ActivePluginsChangeEventArgs (#2341)

This commit is contained in:
Blair 2025-08-06 03:38:11 +10:00 committed by GitHub
parent 6213f7627e
commit 8d29e6b44d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 12 deletions

View file

@ -2,10 +2,8 @@ using System.Collections.Generic;
namespace Dalamud.Plugin; namespace Dalamud.Plugin;
/// <summary> /// <inheritdoc cref="IActivePluginsChangedEventArgs" />
/// Contains data about changes to the list of active plugins. public class ActivePluginsChangedEventArgs : EventArgs, IActivePluginsChangedEventArgs
/// </summary>
public class ActivePluginsChangedEventArgs : EventArgs
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ActivePluginsChangedEventArgs"/> class /// Initializes a new instance of the <see cref="ActivePluginsChangedEventArgs"/> class
@ -19,13 +17,9 @@ public class ActivePluginsChangedEventArgs : EventArgs
this.AffectedInternalNames = affectedInternalNames; this.AffectedInternalNames = affectedInternalNames;
} }
/// <summary> /// <inheritdoc/>
/// Gets the invalidation kind that caused this event to be fired.
/// </summary>
public PluginListInvalidationKind Kind { get; } public PluginListInvalidationKind Kind { get; }
/// <summary> /// <inheritdoc/>
/// Gets the InternalNames of affected plugins.
/// </summary>
public IEnumerable<string> AffectedInternalNames { get; } public IEnumerable<string> AffectedInternalNames { get; }
} }

View file

@ -489,7 +489,7 @@ internal sealed class DalamudPluginInterface : IDalamudPluginInterface, IDisposa
/// Dispatch the active plugins changed event. /// Dispatch the active plugins changed event.
/// </summary> /// </summary>
/// <param name="args">The event arguments containing information about the change.</param> /// <param name="args">The event arguments containing information about the change.</param>
internal void NotifyActivePluginsChanged(ActivePluginsChangedEventArgs args) internal void NotifyActivePluginsChanged(IActivePluginsChangedEventArgs args)
{ {
foreach (var action in Delegate.EnumerateInvocationList(this.ActivePluginsChanged)) foreach (var action in Delegate.EnumerateInvocationList(this.ActivePluginsChanged))
{ {

View file

@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace Dalamud.Plugin;
/// <summary>
/// Contains data about changes to the list of active plugins.
/// </summary>
public interface IActivePluginsChangedEventArgs
{
/// <summary>
/// Gets the invalidation kind that caused this event to be fired.
/// </summary>
PluginListInvalidationKind Kind { get; }
/// <summary>
/// Gets the InternalNames of affected plugins.
/// </summary>
IEnumerable<string> AffectedInternalNames { get; }
}

View file

@ -33,7 +33,7 @@ public interface IDalamudPluginInterface
/// Delegate for events that listen to changes to the list of active plugins. /// Delegate for events that listen to changes to the list of active plugins.
/// </summary> /// </summary>
/// <param name="args">The event arguments containing information about the change.</param> /// <param name="args">The event arguments containing information about the change.</param>
public delegate void ActivePluginsChangedDelegate(ActivePluginsChangedEventArgs args); public delegate void ActivePluginsChangedDelegate(IActivePluginsChangedEventArgs args);
/// <summary> /// <summary>
/// Event that gets fired when loc is changed /// Event that gets fired when loc is changed