private void GenerateStatusEvent(StatusEventArgs args) { if (StatusEventHandler != null && StatusEventHandler.GetInvocationList().Length > 0) { StatusEventHandler(this, args); } }
public void RemoveStatusEventHandler(EventHandler <StatusEventArgs> statusEventHandler) { if (StatusEventHandler != null) { if (Array.IndexOf(StatusEventHandler.GetInvocationList(), statusEventHandler) != -1) { StatusEventHandler -= statusEventHandler; } } }
public void AddStatusEventHandler(EventHandler <StatusEventArgs> statusEventHandler) { if (StatusEventHandler == null) { StatusEventHandler += statusEventHandler; } else { if (Array.IndexOf(StatusEventHandler.GetInvocationList(), statusEventHandler) == -1) { StatusEventHandler += statusEventHandler; } } }