public static void ProcessReceive(IExecutor executor, ReceivedEventArgs args) { if(args == null) throw new ArgumentNullException("args"); //如果执行器参数为空,不抛出异常,直接退出 if(executor == null) return; //通过执行器执行当前请求 executor.Execute(args); }
protected virtual void OnReceived(ReceivedEventArgs args) { //处理接收到的数据 Utility.ProcessReceive(_executor, args); var handler = this.Received; if(handler != null) handler(this, args); }
private void Receiver_Received(object sender, ReceivedEventArgs e) { //激发“Received”事件 this.OnReceived(e); }
protected virtual void OnReceived(ReceivedEventArgs args) { var handler = this.Received; if(handler != null) handler(this, args); }