protected BinaryStateActuator(ComponentId id, IBinaryStateEndpoint endpoint)
            : base(id)
        {
            if (endpoint == null) throw new ArgumentNullException(nameof(endpoint));

            AddState(new StateMachineState(BinaryStateId.Off).WithAction(endpoint.TurnOff));
            AddState(new StateMachineState(BinaryStateId.On).WithAction(endpoint.TurnOn));
        }
Пример #2
0
        protected BinaryStateActuator(ComponentId id, IBinaryStateEndpoint endpoint)
            : base(id)
        {
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }

            AddState(new StateMachineState(BinaryStateId.Off).WithAction(endpoint.TurnOff));
            AddState(new StateMachineState(BinaryStateId.On).WithAction(endpoint.TurnOn));
        }
Пример #3
0
        public async Task <IBinaryStateEndpoint> CreateDemoBinaryComponent(string caption)
        {
            IBinaryStateEndpoint result = null;

            await Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal,
                () =>
            {
                var checkBox       = new CheckBox();
                checkBox.IsEnabled = false;
                checkBox.Content   = caption;

                var endpoint = new CheckBoxBinaryStateEndpoint(checkBox);

                DemoLampsStackPanel.Children.Add(checkBox);

                result = endpoint;
            });

            return(result);
        }
Пример #4
0
 public Socket(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }
Пример #5
0
 public Socket(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }
 public CustomBinaryStateActuator(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }
Пример #7
0
 public Lamp(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }
Пример #8
0
 public CustomBinaryStateActuator(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }
Пример #9
0
 public Lamp(ComponentId id, IBinaryStateEndpoint endpoint)
     : base(id, endpoint)
 {
 }