public UposEventArguments(IUposProperties properties) { Properties = properties; DataEventHandler = EmptyData; ErrorEventHandler = EmptyError; StatusUpdateEventHandler = EmptyStatus; OutputCompleteEventHandler = EmptyOutput; DirectIOEventHandler = EmptyDirectIO; }
protected virtual void OnStatusUpdate(I2cEncoderEventArgs e) { StatusUpdateEventHandler handler = StatusUpdate; if (handler != null) { handler(this, e); } }
protected virtual void OnStatsUpdate(StatusUpdateEventArgs e) { StatusUpdateEventHandler handler = StatusUpdateHandler; if (handler != null) { handler(this, e); } }
protected virtual void OnRaiseStatusChangedEvent(StatusChangedEventArgs e) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. StatusUpdateEventHandler handler = StatusChangedEvent; // Raise the event if (handler != null) { handler(this, e); } }
public static void RemoveChannelListener(string channel, StatusUpdateEventHandler listenerCallback) { var evt = GetChannel(channel); ChanneledEvents[channel] = (StatusUpdateEventHandler)Delegate.Remove(evt, listenerCallback); }