Пример #1
0
 private void InitializeContext()
 {
     this.context             = new DoorContext(Engine);
     this.context.Observer    = ObserverTrace.Instance(traceName);
     this.context.EndHandler += new EventHandler <EventArgs>(StateMachineEnd);
     this.context.EnterInitialState();
 }
Пример #2
0
 public Executor()
 {
     this.actuator         = new FixMachineActuator();
     this.context          = new ExecutorContext(this);
     this.context.Observer = ObserverTrace.Instance("Executor");
     this.context.EnterInitialState();
 }
Пример #3
0
 private void InitializeContext()
 {
     this.context             = new CallDirectorContext(this.callControl, this.callScenario);
     this.context.Observer    = ObserverTrace.Instance(traceName);
     this.context.EndHandler += new EventHandler <EventArgs>(StateMachineEnd);
     this.context.EnterInitialState();
 }
Пример #4
0
 public CallScenario(CallControl callControl)
 {
     this.config              = new CallBase01Config();
     this.context             = new CallBase01Context(callControl, this, this.config);
     this.context.Observer    = ObserverTrace.Instance(traceName);
     this.context.EndHandler += new EventHandler <EventArgs>(StateMachineEnd);
     this.context.EnterInitialState();
 }
Пример #5
0
 public TrafficLight()
 {
     this.light               = new Light();
     this.context             = new TrafficLightContext(light);
     this.context.Observer    = ObserverTrace.Instance(traceName);
     this.context.EndHandler += new EventHandler <EventArgs>(StateMachineEnd);
     this.context.EnterInitialState();
 }
Пример #6
0
 public Ping()
 {
     pingSender.PingCompleted += new PingCompletedEventHandler(PingComplete);
     this.context              = new PingContext(this);
     this.context.Observer     = ObserverTrace.Instance(traceName);
     this.context.EndHandler  += new EventHandler <EventArgs>(StateMachineEnd);
     this.context.EnterInitialState();
     Reset();
 }
 private void InitializeContext(ContextBase context)
 {
     context.Observer = ObserverTrace.Instance(traceName);
     context.RegisterEndHandler(new EventHandler <EventArgs>(End));
     context.EnterInitialState();
 }
Пример #8
0
 public Trader()
 {
     this.context          = new TraderContext(this);
     this.context.Observer = ObserverTrace.Instance("Trader");
     this.context.EnterInitialState();
 }
Пример #9
0
 /// <summary>
 /// Specifies whether an observer should be notified when an error condition is detected
 /// </summary>
 /// <param name="trace">The trace specification</param>
 public static bool TraceErrors(this ObserverTrace trace)
 => (trace & Errors) == Errors;
Пример #10
0
 public static bool TraceCompletions(this ObserverTrace trace)
 => (trace & Completions) == Completions;
Пример #11
0
 public static bool TraceEvents(this ObserverTrace trace)
 => (trace & Events) == Events;
Пример #12
0
 public static bool TraceTransitions(this ObserverTrace trace)
 => (trace & Transitions) == Transitions;