private void OnStatusChanged(StateStatusChangeEventArgs e) { EventHandler <StateStatusChangeEventArgs> handler = StateStatusChange; if (handler != null) { handler(this, e); } }
protected virtual void OnProtocolStateStatusChange(object sender, StateStatusChangeEventArgs e) { EventHandler <StateStatusChangeEventArgs> handler = StateStatusChange; if (handler != null) { handler(this, e); } switch (e.StateStatus) { case State.Statuses.Paused: this.SetCurrentStatus(Statuses.Paused, "Paused from state:" + e.Message); break; case State.Statuses.Started: this.SetCurrentStatus(Statuses.Started, "started from state:" + e.Message); break; case State.Statuses.Stopped: this.SetCurrentStatus(Statuses.Stopped, "Stopped From State:" + e.Message); break; case State.Statuses.FatalError: this.SetCurrentStatus(Statuses.FatalError, "FatalError From State:" + e.Message); ShouldPause = true; break; case State.Statuses.RuntimeError: this.SetCurrentStatus(Statuses.RuntimeError, "RuntimeError From State:" + e.Message); break; case State.Statuses.EndedSuccessfully: this.SetCurrentStatus(Statuses.EndedSuccessfully, "Ended Successfully From State:" + e.Message); break; //Stoping ??, //Starting, ?? // Pausing, ?? } this.Log(string.Format("State {0} status changed to: {1}", e.CurrentState.GetType().Name, e.StateStatus), Logging.LoggingEntery.EnteryTypes.Debug); }
private void HandleStateStatusChange(object sender, StateStatusChangeEventArgs e) { Node N; MethodInvoker action = delegate { DrawProtocolStates(); switch (e.StateStatus) { case State.Statuses.Started: N = graph.FindNode(ProtocolProvider.GetStateDesplayName(e.CurrentState)); N.Attr.FillColor = Microsoft.Msagl.Drawing.Color.MediumSeaGreen; break; case State.Statuses.FatalError: N = graph.FindNode(ProtocolProvider.GetStateDesplayName(e.CurrentState)); N.Attr.FillColor = Microsoft.Msagl.Drawing.Color.Red; break; case State.Statuses.RuntimeError: N = graph.FindNode(ProtocolProvider.GetStateDesplayName(e.CurrentState)); N.Attr.FillColor = Microsoft.Msagl.Drawing.Color.Yellow; break; //TODO:Add all Statuses } ProtocolStatesViewer.Refresh(); }; ProtocolStatesViewer.BeginInvoke(action); string Title = string.Format("{0}:{1}\n{2}",ProtocolProvider.GetStateDesplayName(e.CurrentState), e.StateStatus,e.Message); Log.LogEntery(new LoggingEntery("OctoTipPlus Appilcation","ProtocolUserControl",Title,LoggingEntery.EnteryTypes.Debug)); }
private void OnStatusChanged(StateStatusChangeEventArgs e) { EventHandler<StateStatusChangeEventArgs> handler = StateStatusChange; if (handler != null) { handler(this, e); } }
protected virtual void OnProtocolStateStatusChange(object sender,StateStatusChangeEventArgs e) { EventHandler<StateStatusChangeEventArgs> handler = StateStatusChange; if (handler != null) { handler(this, e); } switch(e.StateStatus) { case State.Statuses.Paused: this.SetCurrentStatus(Statuses.Paused,"Paused from state:" + e.Message ); break; case State.Statuses.Started: this.SetCurrentStatus(Statuses.Started,"started from state:" + e.Message ); break; case State.Statuses.Stopped: this.SetCurrentStatus(Statuses.Stopped,"Stopped From State:" + e.Message ); break; case State.Statuses.FatalError: this.SetCurrentStatus(Statuses.FatalError,"FatalError From State:" + e.Message ); ShouldPause = true; break; case State.Statuses.RuntimeError: this.SetCurrentStatus(Statuses.RuntimeError,"RuntimeError From State:" + e.Message ); break; case State.Statuses.EndedSuccessfully: this.SetCurrentStatus(Statuses.EndedSuccessfully,"Ended Successfully From State:" + e.Message ); break; //Stoping ??, //Starting, ?? // Pausing, ?? } this.Log(string.Format("State {0} status changed to: {1}",e.CurrentState.GetType().Name,e.StateStatus),Logging.LoggingEntery.EnteryTypes.Debug); }