public static void RemoveListner(EventType type, MyEventDelegate function) { if (eventDictionary.ContainsKey(type) && eventDictionary[type] != null) { eventDictionary[type] -= function; } }
public static void AddListner(EventType type, MyEventDelegate function) { if (!eventDictionary.ContainsKey(type)) { eventDictionary.Add(type, null); } eventDictionary[type] += function; }
private void button1_Click(object sender, EventArgs e) { MyEventDelegate med = userControlButtonClicked; if (med != null) { med(this, "1"); } }
internal void NonPublicRemoveMethod(MyEventDelegate delegate_) { }
internal void NonPublicAddMethod(MyEventDelegate delegate_) { }
public void PublicRemoveMethod(MyEventDelegate delegate_) { }
// ReSharper disable UnusedParameter.Local public void PublicAddMethod(MyEventDelegate delegate_) { }