コード例 #1
0
        private void HandleParsedLineReceived(ParsedLineEventArgs parsedLine)
        {
            this.OnParsedLineReceived(parsedLine);
            if (parsedLine.PreventProcessing)
            {
                return;
            }
            var eventArgs = new ParameterEventReceivedEventArgs(parsedLine.Parameter, parsedLine.Id);

            this.Events[parsedLine.Command].OnEvent(eventArgs);
            if (eventArgs.PreventProcessing)
            {
                return;
            }

            if (parsedLine.Command == "_")
            {
                this.OnAnswerReceived(parsedLine);
                if (parsedLine.PreventProcessing)
                {
                    return;
                }
                List <Action <ParsedLineEventArgs> > onAnswerList;
                if (this.onAnswerDelegates.TryGetValue(parsedLine.Id, out onAnswerList))
                {
                    foreach (var action in onAnswerList)
                    {
                        action.BeginInvoke(parsedLine, null, null);
                    }
                }
            }
        }
コード例 #2
0
        internal void OnEvent(ParameterEventReceivedEventArgs e)
        {
            EventHandler <ParameterEventReceivedEventArgs> handler = this.Event;

            if (handler != null)
            {
                foreach (
                    var singleHandler in (EventHandler <ParameterEventReceivedEventArgs>[])handler.GetInvocationList())
                {
                    if (e.PreventProcessing)
                    {
                        return;
                    }
                    singleHandler(this, e);
                }
            }
        }
コード例 #3
0
 internal void OnEvent(ParameterEventReceivedEventArgs e)
 {
     EventHandler<ParameterEventReceivedEventArgs> handler = this.Event;
     if (handler != null)
     {
         foreach (
             var singleHandler in (EventHandler<ParameterEventReceivedEventArgs>[])handler.GetInvocationList())
         {
             if (e.PreventProcessing)
             {
                 return;
             }
             singleHandler(this, e);
         }
     }
 }
コード例 #4
0
        private void HandleParsedLineReceived(ParsedLineEventArgs parsedLine)
        {
            this.OnParsedLineReceived(parsedLine);
            if (parsedLine.PreventProcessing)
            {
                return;
            }
            var eventArgs = new ParameterEventReceivedEventArgs(parsedLine.Parameter, parsedLine.Id);
            this.Events[parsedLine.Command].OnEvent(eventArgs);
            if (eventArgs.PreventProcessing)
            {
                return;
            }

            if (parsedLine.Command == "_")
            {
                this.OnAnswerReceived(parsedLine);
                if (parsedLine.PreventProcessing)
                {
                    return;
                }
                List<Action<ParsedLineEventArgs>> onAnswerList;
                if (this.onAnswerDelegates.TryGetValue(parsedLine.Id, out onAnswerList))
                {
                    foreach (var action in onAnswerList)
                    {
                        action.BeginInvoke(parsedLine, null, null);
                    }
                }
            }
        }