diff options
| author | Bond_009 <bond.009@outlook.com> | 2018-12-28 15:21:02 +0100 |
|---|---|---|
| committer | Vasily <JustAMan@users.noreply.github.com> | 2019-01-05 01:49:52 +0300 |
| commit | 391b48614d598b5fbfad68b610520a5ae7a57b70 (patch) | |
| tree | ad5f23fcd90a22e0f986bff7aaa65eae5c73ed95 /MediaBrowser.Common | |
| parent | e4a041b8321e49fd9b21fb0f890caf23d4752212 (diff) | |
Remove FireEventIfNotNull
It's a pretty useless "helper" class
Diffstat (limited to 'MediaBrowser.Common')
| -rw-r--r-- | MediaBrowser.Common/Events/EventHelper.cs | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/MediaBrowser.Common/Events/EventHelper.cs b/MediaBrowser.Common/Events/EventHelper.cs index 04a2270e3..2630ce7da 100644 --- a/MediaBrowser.Common/Events/EventHelper.cs +++ b/MediaBrowser.Common/Events/EventHelper.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; namespace MediaBrowser.Common.Events { + // TODO: @bond Remove /// <summary> /// Class EventHelper /// </summary> @@ -59,50 +60,5 @@ namespace MediaBrowser.Common.Events }); } } - - /// <summary> - /// Fires the event. - /// </summary> - /// <param name="handler">The handler.</param> - /// <param name="sender">The sender.</param> - /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> - /// <param name="logger">The logger.</param> - public static void FireEventIfNotNull(EventHandler handler, object sender, EventArgs args, ILogger logger) - { - if (handler != null) - { - try - { - handler(sender, args); - } - catch (Exception ex) - { - logger.LogError(ex, "Error in event handler"); - } - } - } - - /// <summary> - /// Fires the event. - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="handler">The handler.</param> - /// <param name="sender">The sender.</param> - /// <param name="args">The args.</param> - /// <param name="logger">The logger.</param> - public static void FireEventIfNotNull<T>(EventHandler<T> handler, object sender, T args, ILogger logger) - { - if (handler != null) - { - try - { - handler(sender, args); - } - catch (Exception ex) - { - logger.LogError(ex, "Error in event handler"); - } - } - } } } |
