/// <summary> /// Stops event Logging /// </summary> private void StopLogging() { if (currentProxy != null) { //unsubscribe from events. foreach (EventDescriptor ed in currentProxy.GetEvents()) { currentProxy.UnsubscribeEvent(ed); } currentProxy.EventFired -= new ControlProxyEventHandler(ProxyEventFired); } }
public static ControlProxy unsubscribeAllEvents(this ControlProxy controlProxy) { //"[ControlProxy] Unsubscribing to All Events".info(); if (controlProxy.notNull()) { foreach (EventDescriptor ed in controlProxy.GetEvents()) { controlProxy.UnsubscribeEvent(ed); } } return(controlProxy); }