summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/InternalExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/InternalExtensions.cs')
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs
index ff3925fb..b51ff6a8 100644
--- a/src/SMAPI/Framework/InternalExtensions.cs
+++ b/src/SMAPI/Framework/InternalExtensions.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Xna.Framework.Graphics;
+using StardewModdingAPI.Framework.Events;
using StardewModdingAPI.Framework.Reflection;
using StardewValley;
@@ -40,6 +41,17 @@ namespace StardewModdingAPI.Framework
}
/****
+ ** ManagedEvent
+ ****/
+ /// <summary>Raise the event and notify all handlers.</summary>
+ /// <typeparam name="TEventArgs">The empty event arguments type to construct.</typeparam>
+ /// <param name="event">The event to raise.</param>
+ public static void RaiseEmpty<TEventArgs>(this ManagedEvent<TEventArgs> @event) where TEventArgs : new()
+ {
+ @event.Raise(Singleton<TEventArgs>.Instance);
+ }
+
+ /****
** Exceptions
****/
/// <summary>Get a string representation of an exception suitable for writing to the error log.</summary>