示例#1
0
 public UposEventArguments(IUposProperties properties)
 {
     Properties                 = properties;
     DataEventHandler           = EmptyData;
     ErrorEventHandler          = EmptyError;
     StatusUpdateEventHandler   = EmptyStatus;
     OutputCompleteEventHandler = EmptyOutput;
     DirectIOEventHandler       = EmptyDirectIO;
 }
示例#2
0
        protected virtual void OnStatusUpdate(I2cEncoderEventArgs e)
        {
            StatusUpdateEventHandler handler = StatusUpdate;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#3
0
        protected virtual void OnStatsUpdate(StatusUpdateEventArgs e)
        {
            StatusUpdateEventHandler handler = StatusUpdateHandler;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        public static void RemoveChannelListener(string channel, StatusUpdateEventHandler listenerCallback)
        {
            var evt = GetChannel(channel);

            ChanneledEvents[channel] = (StatusUpdateEventHandler)Delegate.Remove(evt, listenerCallback);
        }