-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmitterEventArgs.cs
32 lines (24 loc) · 1.04 KB
/
EmitterEventArgs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
namespace Emi {
public class EmitterEventArgs : EventArgs {
public String EventName { get; set; }
public IDictionary<String, Object> Data { get; set; } = new Dictionary<String, Object>();
public EmitterEventArgs(String eventName) {
if (String.IsNullOrEmpty(eventName))
throw new ArgumentNullException(nameof(eventName));
EventName = eventName;
}
public EmitterEventArgs(String eventName, params KeyValuePair<String, Object>[] data) {
if (String.IsNullOrEmpty(eventName))
throw new ArgumentNullException(nameof(eventName));
EventName = eventName;
if (data == null)
throw new ArgumentNullException(nameof(data));
if (data.Length == 0)
throw new ArgumentOutOfRangeException(nameof(data));
foreach (KeyValuePair<String, Object> dataItem in data)
Data.Add(dataItem.Key, dataItem.Value);
}
}
}