Example #1
0
        protected virtual void OnNextButtonClick(object sender, EventArgs e)
        {
            int num;

            if (DesignMode)
            {
                CurrentStepIndex++;
                return;
            }
            else
            {
                num = 0;
                if (!(WizardSteps[CurrentStepIndex] is StartStep))
                {
                    if ((WizardSteps[CurrentStepIndex] is FinishStep))
                    {
                        num = -1;
                    }
                }
                else
                {
                    num = 1;
                }
            }
            if (NextButtonClick == null)
            {
                bool noFinish = false;
                int  num2     = 0;
                if (!(WizardSteps[CurrentStepIndex + 1] is StartStep))
                {
                    if (!(WizardSteps[CurrentStepIndex + 1] is FinishStep))
                    {
                        noFinish = true;
                    }
                    else
                    {
                        num2 = -1;
                    }
                }
                else
                {
                    num2 = 1;
                }
                if (((parenthesisCounter + num) + num2) >= 0)
                {
                    if ((((parenthesisCounter + num) + num2) != 0) || !noFinish)
                    {
                        WizardSteps[CurrentStepIndex + 1].BackStepIndex = CurrentStepIndex;
                        CurrentStepIndex++;
                        parenthesisCounter += num;
                    }
                }
                else
                {
                    throw new InvalidOperationException("The steps must be well formed, so there cannot be an IntermediateStep without enclosing.");
                }
            }
            else
            {
                WizardNextButtonClickEventArgs args = new WizardNextButtonClickEventArgs(this);
                NextButtonClick(this, args);
                if (args.Cancel)
                {
                    return;
                }
                if (args.NextStepIndex != -1)
                {
                    WizardSteps[args.NextStepIndex].BackStepIndex = CurrentStepIndex;
                    CurrentStepIndex    = args.NextStepIndex;
                    parenthesisCounter += num;
                    return;
                }
                WizardSteps[CurrentStepIndex + 1].BackStepIndex = CurrentStepIndex;
                CurrentStepIndex++;
                parenthesisCounter += num;
                return;
            }
        }
Example #2
0
        private void wizardControl_NextButtonClick(WizardControl sender, WizardNextButtonClickEventArgs e)
        {
            switch (wizardControl.CurrentStepIndex)
            {
                case 0:
                    dataTable = null;
                    break;

                case 1:
                    if (File.Exists(tbDatapath.Text) && loadDataTable())
                    {
                        loadInputCombobox();
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                    break;

                case 2:
                    loadOutputCombobox();
                    break;

                case 3:
                    loadStringCombobox();
                    break;

                default:
                    break;
            }
        }
Example #3
0
 protected virtual void OnNextButtonClick(object sender, EventArgs e)
 {
     int num;
     if (DesignMode)
     {
         CurrentStepIndex++;
         return;
     }
     else
     {
         num = 0;
         if (!(WizardSteps[CurrentStepIndex] is StartStep))
         {
             if ((WizardSteps[CurrentStepIndex] is FinishStep))
             {
                 num = -1;
             }
         }
         else
         {
             num = 1;
         }
     }
     if (NextButtonClick == null)
     {
         bool noFinish = false;
         int num2 = 0;
         if (!(WizardSteps[CurrentStepIndex + 1] is StartStep))
         {
             if (!(WizardSteps[CurrentStepIndex + 1] is FinishStep))
             {
                 noFinish = true;
             }
             else
             {
                 num2 = -1;
             }
         }
         else
         {
             num2 = 1;
         }
         if (((parenthesisCounter + num) + num2) >= 0)
         {
             if ((((parenthesisCounter + num) + num2) != 0) || !noFinish)
             {
                 WizardSteps[CurrentStepIndex + 1].BackStepIndex = CurrentStepIndex;
                 CurrentStepIndex++;
                 parenthesisCounter += num;
             }
         }
         else
         {
             throw new InvalidOperationException("The steps must be well formed, so there cannot be an IntermediateStep without enclosing.");
         }
     }
     else
     {
         WizardNextButtonClickEventArgs args = new WizardNextButtonClickEventArgs(this);
         NextButtonClick(this, args);
         if (args.Cancel)
         {
             return;
         }
         if (args.NextStepIndex != -1)
         {
             WizardSteps[args.NextStepIndex].BackStepIndex = CurrentStepIndex;
             CurrentStepIndex = args.NextStepIndex;
             parenthesisCounter += num;
             return;
         }
         WizardSteps[CurrentStepIndex + 1].BackStepIndex = CurrentStepIndex;
         CurrentStepIndex++;
         parenthesisCounter += num;
         return;
     }
 }