示例#1
0
        public override void SetInput(DisplayDeviceInput input)
        {
            if (AvailableInputs.All(i => i != input))
            {
                throw new Exception("Invalid Input");
            }

            ResetPolling();

            switch (input)
            {
            case DisplayDeviceInput.BuiltIn:
                Send("Source=0");
                break;

            case DisplayDeviceInput.DisplayPort:
                Send("Source=1");
                break;

            case DisplayDeviceInput.HDMI1:
                Send("Source=2");
                break;

            case DisplayDeviceInput.VGA:
                Send("Source=3");
                break;

            case DisplayDeviceInput.Wireless:
                Send("Source=4");
                break;
            }
        }
示例#2
0
        private void OnAddInput()
        {
            if (SelectedInput == null)
            {
                return;
            }

            OnCloseFlyout();

            Inputs.Add(new InputViewModel(new InputModel(), SelectedInput));

            // (Konrad) Cleanup Available Inputs
            AvailableInputs.Remove(SelectedInput);
            SelectedInput = null;
        }
示例#3
0
 private void OnInputDeleted(InputDeleted obj)
 {
     // (Konrad) Restore the input in the dropdown and cleanup
     AvailableInputs.Add(obj.InputViewModel.Input);
     Inputs.Remove(obj.InputViewModel);
 }