/// <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); }
public static ControlProxy subscribeToEvents(this ControlProxy controlProxy, EventFilterDialog dialog) { if (controlProxy.notNull() && dialog.notNull() && dialog.EventList.notNull()) { "[ControlProxy] Subscribing to Events".info(); foreach (EventDescriptor ed in controlProxy.GetEvents()) { if (dialog.EventList[ed.Name].Display) { controlProxy.SubscribeEvent(ed); } } } return(controlProxy); }
/// <summary> /// Starts event logging /// </summary> private void StartLogging() { if (tsButtonStartStop.Checked) { currentProxy = propertyGrid.SelectedObject as ControlProxy; if (currentProxy != null) { //unsubscribe from events. foreach (EventDescriptor ed in currentProxy.GetEvents()) { if (dialog.EventList[ed.Name].Display) { currentProxy.SubscribeEvent(ed); } } currentProxy.EventFired += new ControlProxyEventHandler(ProxyEventFired); } } }