private void Form_OptionSelected(object sender, OptionSelectedEventArgs e)
        {
            if (e.Key == nameof(Model.PayloadType))
            {
                if (e.Value == MessageTemplate.PayloadTypes_Binary)
                {
                    FormAdapter.HideView(nameof(Model.TextPayload));
                    FormAdapter.ShowView(nameof(Model.BinaryPayload));
                }
                else if (e.Value == MessageTemplate.PayloadTypes_Text)
                {
                    FormAdapter.ShowView(nameof(Model.TextPayload));
                    FormAdapter.HideView(nameof(Model.BinaryPayload));
                }
                else
                {
                    FormAdapter.HideView(nameof(Model.TextPayload));
                    FormAdapter.HideView(nameof(Model.BinaryPayload));
                }
            }

            if (e.Key == nameof(Model.Transport))
            {
                if (e.Value == LagoVista.IoT.Simulator.Admin.Models.Simulator.Transport_RestHttp)
                {
                    SetForREST();
                }
            }
        }
Beispiel #2
0
 public void OnOptionSelected(object sender, OptionSelectedEventArgs args)
 {
     if (args.ChosenOption == "Scoreboard")
     {
         ShowScoreboard();
     }
 }
Beispiel #3
0
 protected void OnOptionSelected(OptionSelectedEventArgs e)
 {
     if (OptionSelected != null)
     {
         OptionSelected(this, e);
     }
 }
Beispiel #4
0
 public void OnOptionSelected(object sender, OptionSelectedEventArgs args)
 {
     if (args.ChosenOption == "Instructions")
     {
         ShowInstructions();
     }
 }
Beispiel #5
0
 public void OnOptionSelected(object sender, OptionSelectedEventArgs args)
 {
     if (args.ChosenOption == "Play")
     {
         PlayGame();
     }
 }
Beispiel #6
0
 public void OnOptionSelected(object sender, OptionSelectedEventArgs args)
 {
     if (args.ChosenOption == "Exit")
     {
         ExitProg();
     }
 }
Beispiel #7
0
        /**
         * Sends the selection event when a user selects an
         * option from the menu
         *
         * int currentIndex The current index of the option selected
         *
         * @return null
         * */
        private void SendSelectionEvent(int currentIndex)
        {
            var eventArgs = new OptionSelectedEventArgs
            {
                Option = GetOptionFromIndex(currentIndex)
            };

            OnOptionSelect(eventArgs);
        }
Beispiel #8
0
        public string GetSelection()
        {
            _finished = false;
            while (!_finished)                               // Main loop
            {
                _display.Display(_options, _selectedOption); // Display the options.
                SwitchOnKey();                               // Get key and choose what to do based on what was pressed.
            }

            var eventArgs = new OptionSelectedEventArgs(); // Call event with chosen option as argument

            eventArgs.ChosenOption = _options[_selectedOption];
            OnOptionSelected(eventArgs);

            return(_options[_selectedOption]);
        }
Beispiel #9
0
 private void Form_OptionSelected(object sender, OptionSelectedEventArgs e)
 {
     OptionSelected(e.Key, e.Value);
     FormAdapter.Refresh();
 }
Beispiel #10
0
 /**
  * Event method called when the selection option
  * is called
  * */
 protected virtual void OnOptionSelect(OptionSelectedEventArgs e)
 {
     OptionSelect?.Invoke(this, e);
 }
 public void NotifyOptionSelected(OptionSelectedEventArgs.Options selectedOption, int contextAddress)
 {
     OnOptionSelected(this, new OptionSelectedEventArgs { SelectedOption = selectedOption, ContextAddress = contextAddress });
 }
Beispiel #12
0
 private void Picker_OptionSelected(object sender, OptionSelectedEventArgs e)
 {
     Form.InvokeOptionSelected(e);
 }
Beispiel #13
0
 private void QuestionControl_OptionSelected(object s, OptionSelectedEventArgs e) =>
 ViewModel.OptionSelected(e.SelectedOption);