public void Subscribe() { WithEvent we = new WithEvent(); // This is how you subscribe the handler of the second class we.NewMouseEvent += Handler; }
public void SkipsEvents() { var original = new WithEvent(); original.eventhandler += (sender, args) => { }; original.action += () => { }; original.func += () => 1; var jObject = JObject.FromObject(original, CreateSerializer()); jObject.ShouldNotContainKey("eventhandler"); jObject.ShouldNotContainKey("action"); jObject.ShouldNotContainKey("func"); var copy = jObject.ToObject <WithEvent>(); copy.GetEventHandler().ShouldBe(null); copy.action.ShouldBe(null); copy.func.ShouldBe(null); }
internal TaskServiceWithOnSuccessTransition(TaskServiceWithOnSuccessTransitionTo service, Target target, params Target[] targets) { Service = service.Service; OnSuccessTransition = WithEvent.OnServiceSuccess().TransitionTo.Multiple(target, targets); Service.Definition.OnSuccessDefinition = Option.From <OneOfUnion <TransitionDefinition, UnguardedTransitionDefinition, UnguardedContextTransitionDefinition> >(OnSuccessTransition); }
internal ActivityServiceWithOnErrorTransition(ActivityServiceWithOnErrorTransitionTo service, Target target, params Target[] targets) { Service = service.Service; Service.Definition.OnErrorTransition = Option.From <OneOfUnion <TransitionDefinition, UnguardedTransitionDefinition, UnguardedContextTransitionDefinition> >(WithEvent.OnServiceError().TransitionTo.Multiple(target, targets)); }
public void SkipsEvents() { var original = new WithEvent(); original.eventhandler += (sender, args) => { }; original.action += () => { }; original.func += () => 1; var jObject = JObject.FromObject(original, CreateSerializer()); jObject.ShouldNotContainKey("eventhandler"); jObject.ShouldNotContainKey("action"); jObject.ShouldNotContainKey("func"); var copy = jObject.ToObject<WithEvent>(); copy.GetEventHandler().ShouldBe(null); copy.action.ShouldBe(null); copy.func.ShouldBe(null); }
public Sut(WithEvent withEvent) { this.withEvent = withEvent; }
public Sut(WithEvent withEvent) { this.withEvent = withEvent; this.withEvent.MyEvent += () => count++; }
public OrthogonalStatenodeWithDoneTransition(OrthogonalStatenodeWithDoneTransitionTo orthogonal, Target target, params Target[] targets) { Definition = orthogonal.Definition; DoneTransitionBuilder = WithEvent.OnDone().TransitionTo.Multiple(target, targets); }
public CompoundStatenodeWithDoneTransition(CompoundStatenodeWithDoneTransitionTo compound, Target target, params Target[] targets) { Definition = compound.Definition; DoneTransitionBuilder = WithEvent.OnDone().TransitionTo.Multiple(target, targets); }