diff options
Diffstat (limited to 'src/StardewModdingAPI/Events')
-rw-r--r-- | src/StardewModdingAPI/Events/ContentEventHandler.cs | 8 | ||||
-rw-r--r-- | src/StardewModdingAPI/Events/ContentEvents.cs | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Events/ContentEventHandler.cs b/src/StardewModdingAPI/Events/ContentEventHandler.cs new file mode 100644 index 00000000..2a7e75d1 --- /dev/null +++ b/src/StardewModdingAPI/Events/ContentEventHandler.cs @@ -0,0 +1,8 @@ +namespace StardewModdingAPI.Events +{ + /// <summary>Represents a method that will handle a content event.</summary> + /// <param name="sender">The source of the event.</param> + /// <param name="e">The event arguments.</param> + /// <remarks>This deviates from <see cref="System.EventHandler{T}"/> in allowing <c>T</c> to be an interface instead of a concrete class. While .NET Framework 4.5 allows that, the current .NET Framework 4.0 targeted by SMAPI to improve compatibility does not.</remarks> + public delegate void ContentEventHandler(object sender, IContentEventHelper e); +} diff --git a/src/StardewModdingAPI/Events/ContentEvents.cs b/src/StardewModdingAPI/Events/ContentEvents.cs index 9418673a..339e90fd 100644 --- a/src/StardewModdingAPI/Events/ContentEvents.cs +++ b/src/StardewModdingAPI/Events/ContentEvents.cs @@ -28,7 +28,7 @@ namespace StardewModdingAPI.Events public static event EventHandler<EventArgsValueChanged<string>> AfterLocaleChanged; /// <summary>Raised when an XNB file is being read into the cache. Mods can change the data here before it's cached.</summary> - internal static event EventHandler<IContentEventHelper> AfterAssetLoaded; + internal static event ContentEventHandler AfterAssetLoaded; /********* |