Пример #1
0
 public virtual void OnEnterPressed()
 {
     if (!show)
     {
         show = true;
         if (!hasLoadedList || reloadOnFocus)
         {
             CreateNewList(OnCreateChildList());
         }
         if (emptyListListInfoDialog != null && items.Count == 0)
         {
             emptyListListInfoDialog.SetFocus(this);
         }
         else
         {
             Parent.SetFocus(this);
         }
     }
     else
     {
         if (items.Count != 0)
         {
             items [scrollPos + cursorPos].OnEnterPressed();
         }
     }
 }
Пример #2
0
 private void OnCompileDialogExit(QuestionDialog dialog)
 {
     if (dialog.IsPositiveSelected)
     {
         compileDialog.SetFocus(Parent);
     }
     else
     {
         programSelectDialog.SetFocus(this, OnSelectDialogExit);
     }
 }
Пример #3
0
        private void OnCheckCompleted(ProgressDialog dialog)
        {
            if (!checkDialog.Dialog.Ok)
            {
                Parent.RemoveFocus(this);
                return;
            }

            if (newImage)
            {
                infoDialog = new ItemWithDialog <InfoDialog>(new InfoDialog("New image available. Download it from www.monobrick.dk or ftp://soborg.net"));
                infoDialog.SetFocus(this);
            }
            else
            {
                if (newFirmwareApp)
                {
                    questionDialog.SetFocus(this, OnQuestionCompleted);
                }
                else
                {
                    if (newAddin)
                    {
                        infoDialog = new ItemWithDialog <InfoDialog>(new InfoDialog("New Xamarin Add-in. Download it from www.monobrick.dk or ftp://soborg.net"));
                        infoDialog.SetFocus(this);
                    }
                    else
                    {
                        infoDialog = new ItemWithDialog <InfoDialog>(new InfoDialog("No updates available"));
                        infoDialog.SetFocus(this);
                    }
                }
            }
        }
Пример #4
0
 private void OnQuestionCompleted(QuestionDialog dialog)
 {
     if (dialog.IsPositiveSelected)
     {
         updateDialog.SetFocus(this, OnUpdateCompleted);
     }
 }
Пример #5
0
 private void OnDone(Exception e)
 {
     if (!useEscToStop)
     {
         Parent.ResumeButtonEvents();
     }
     if (e != null)
     {
         exceptionInfoDialog.SetFocus(Parent);
     }
     else
     {
         Parent.RemoveFocus(this);
     }
 }
Пример #6
0
 public override void OnEnterPressed()
 {
     if (!hasFocus)
     {
         if (information == null)
         {
             dialog.SetFocus(this, OnDialogExit);
         }
         else
         {
             Parent.SetFocus(this);
             hasFocus = true;
         }
     }
     else
     {
         hasFocus = false;
         Parent.RemoveFocus(this);
     }
 }
Пример #7
0
 public override void RemoveFocus(IChildItem item)
 {
     base.RemoveFocus(item);
     if (item is ItemWithDialog <QuestionDialog> )
     {
         if (questionDialog.Dialog.IsPositiveSelected)
         {
             FirmwareSettings.GeneralSettings.ConnectToWiFiAtStartUp     = true;
             FirmwareSettings.GeneralSettings.CheckForSwUpdatesAtStartUp = true;
             FirmwareSettings.Save();
         }
     }
     else
     {
         if (this.Checked)
         {
             questionDialog.SetFocus(this);
         }
     }
 }
Пример #8
0
        private void OnSelectDialogExit(SelectDialog <string> dialog)
        {
            if (!dialog.EscPressed)
            {
                switch (dialog.GetSelectionIndex())
                {
                case 0:
                    var startDialog = new ExecuteProgramDialog(this.programInformation, false, useEscToStop);
                    startDialog.Start(Parent);
                    break;

                case 1:
                    if (!programInformation.IsAOTCompiled)
                    {
                        compileBeforeExecution.SetFocus(Parent, OnCompileInfoDialogExit);
                    }
                    else
                    {
                        var start = new ExecuteProgramDialog(this.programInformation, true, useEscToStop);
                        start.Start(Parent);
                    }
                    break;

                case 2:
                    if (programInformation.IsAOTCompiled)
                    {
                        aotQuestionDialog.SetFocus(Parent, OnCompileDialogExit);
                    }
                    else
                    {
                        compileDialog.SetFocus(Parent);
                    }
                    break;

                case 3:
                    deleteQuestionDialog.SetFocus(Parent, OnDeleteDialogExit);
                    break;
                }
            }
        }
Пример #9
0
 public override void OnEnterPressed()
 {
     questionDialog.SetFocus(this, OnExit);
 }
Пример #10
0
 public override void OnEnterPressed()
 {
     itemStep.Checked = this.Checked;
     dialogItem.SetFocus(this);
 }
Пример #11
0
 public override void OnEnterPressed()
 {
     checkDialog.SetFocus(this, OnCheckCompleted);
 }
Пример #12
0
 public override void OnEnterPressed()
 {
     programSelectDialog.SetFocus(this, OnSelectDialogExit);
 }