Exemplo n.º 1
0
        private void RaiseOutputEvent(ControlId controlId, float value)
        {
            var handler = OutputEvent;

            if (handler != null)
            {
                handler(this, new ControlEvent(controlId, value));
            }
        }
Exemplo n.º 2
0
        public float GetOutputValue(ControlId controlId)
        {
            Guard.NotNull(controlId, nameof(controlId));

            ControlState state;

            if (!_controls.TryGetValue(controlId, out state))
            {
                return(0);
            }

            return(state.OutputValue);
        }
Exemplo n.º 3
0
        public void SetOutputValue(ControlId controlId, float value)
        {
            Guard.NotNull(controlId, nameof(controlId));

            ControlState state;

            if (!_controls.TryGetValue(controlId, out state))
            {
                state = new ControlState();
                _controls.Add(controlId, state);
            }

            if (state.OutputValue == value)
            {
                return;
            }

            state.OutputValue = value;
            RaiseOutputEvent(controlId, value);
        }
Exemplo n.º 4
0
 public ControlEvent(ControlId controlId, float value)
 {
     ControlId = Guard.NotNull(controlId, nameof(controlId));
     Value     = value;
 }