mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
refactor: validation
This commit is contained in:
parent
b24c93df09
commit
bd8f7f15a0
1 changed files with 9 additions and 0 deletions
|
|
@ -14,6 +14,9 @@ namespace ICD.Common.Utils.Extensions
|
|||
/// <param name="sender"></param>
|
||||
public static void Raise(this EventHandler extends, object sender)
|
||||
{
|
||||
if (sender == null)
|
||||
throw new ArgumentNullException("sender");
|
||||
|
||||
if (extends != null)
|
||||
extends(sender, EventArgs.Empty);
|
||||
}
|
||||
|
|
@ -28,6 +31,12 @@ namespace ICD.Common.Utils.Extensions
|
|||
public static void Raise<T>(this EventHandler<T> extends, object sender, T args)
|
||||
where T : EventArgs
|
||||
{
|
||||
if (sender == null)
|
||||
throw new ArgumentNullException("sender");
|
||||
|
||||
if (args == null)
|
||||
throw new ArgumentNullException("args");
|
||||
|
||||
if (extends != null)
|
||||
extends(sender, args);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue