예제 #1
0
 public void WizardEvent(WizardEventArgs WizardEventArgs)
 {
     if (WizardEventArgs.EventType == EventType.Init)
     {
         AddAPIModelWizard = ((AddAPIModelWizard)WizardEventArgs.Wizard);
         App.ObjFieldBinding(XMLTemplatesGrid.AddCheckBox("Avoid Duplicates Nodes", null), CheckBox.IsCheckedProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.AvoidDuplicatesNodes));
         mWSDLParser = new WSDLParser();
         AddAPIModelWizard.mWSDLParser = mWSDLParser;
         GingerCore.General.ObjFieldBinding(xURLTextBox, TextBox.TextProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.URL));
         xURLTextBox.AddValidationRule(eValidationRule.CannotBeEmpty);
     }
     else if (WizardEventArgs.EventType == EventType.LeavingForNextPage)
     {
         if (APITypeComboBox.SelectedValue.ToString() == eAPIType.WSDL.ToString())
         {
             AddAPIModelWizard.APIType     = eAPIType.WSDL;
             AddAPIModelWizard.mWSDLParser = mWSDLParser;
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.XMLTemplates.ToString())
         {
             AddAPIModelWizard.APIType = eAPIType.XMLTemplates;
             ValidateXMLTemplatesInputs(WizardEventArgs);
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.JsonTemplate.ToString())
         {
             AddAPIModelWizard.APIType = eAPIType.JsonTemplate;
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.Swagger.ToString())
         {
             AddAPIModelWizard.APIType = eAPIType.Swagger;
         }
     }
 }
        public void WizardEvent(WizardEventArgs WizardEventArgs)
        {
            if (WizardEventArgs.EventType == EventType.Init)
            {
                AddAPIModelWizard = ((AddAPIModelWizard)WizardEventArgs.Wizard);
                App.ObjFieldBinding(XMLTemplatesGrid.AddCheckBox("Avoid Duplicates Nodes", null), CheckBox.IsCheckedProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.AvoidDuplicatesNodes));
                mWSDLParser = new WSDLParser();

                GingerCore.General.ObjFieldBinding(xURLTextBox, TextBox.TextProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.URL));
                xURLTextBox.AddValidationRule(eValidationRule.CannotBeEmpty);
            }
            else if (WizardEventArgs.EventType == EventType.LeavingForNextPage)
            {
                if (APITypeComboBox.SelectedValue.ToString() == eAPIType.WSDL.ToString())
                {
                    AddAPIModelWizard.APIType     = eAPIType.WSDL;
                    AddAPIModelWizard.mWSDLParser = mWSDLParser;
                    //mWSDLParser.ValidateWSDLInputs(URLTextBox.Text,URLRadioButton.IsChecked, WizardEventArgs);
                }
                else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.XMLTemplates.ToString())
                {
                    AddAPIModelWizard.APIType = eAPIType.XMLTemplates;
                    ValidateXMLTemplatesInputs(WizardEventArgs);
                }
                else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.JsonTemplate.ToString())
                {
                    AddAPIModelWizard.APIType = eAPIType.JsonTemplate;
                }
            }
            //else if (WizardEventArgs.EventType == EventType.Active)
            //{
            //    AddAPIModelWizard.NextEnabled = true;
            //    AddAPIModelWizard.FinishEnabled = false;
            //    AddAPIModelWizard.PrevEnabled = false;
            //}
        }
 public void WizardEvent(WizardEventArgs WizardEventArgs)
 {
     if (WizardEventArgs.EventType == EventType.Init)
     {
         AddAPIModelWizard = ((AddAPIModelWizard)WizardEventArgs.Wizard);
         GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(XMLTemplatesGrid.AddCheckBox("Avoid Duplicates Nodes", null), CheckBox.IsCheckedProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.AvoidDuplicatesNodes));
         mWSDLParser = new WSDLParser();
         AddAPIModelWizard.mWSDLParser = mWSDLParser;
         GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xURLTextBox, TextBox.TextProperty, AddAPIModelWizard, nameof(AddAPIModelWizard.URL));
         xURLTextBox.AddValidationRule(eValidationRule.CannotBeEmpty);
     }
     else if (WizardEventArgs.EventType == EventType.LeavingForNextPage)
     {
         if (APITypeComboBox.SelectedValue.ToString() == eAPIType.WSDL.ToString())
         {
             AddAPIModelWizard.APIType   = eAPIType.WSDL;
             WizardEventArgs.CancelEvent = true;
             if (!string.IsNullOrWhiteSpace(xURLTextBox.Text))
             {
                 if (ValidateFile(xURLTextBox.Text))
                 {
                     WizardEventArgs.CancelEvent   = false;
                     AddAPIModelWizard.mWSDLParser = mWSDLParser;
                 }
             }
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.XMLTemplates.ToString())
         {
             AddAPIModelWizard.APIType   = eAPIType.XMLTemplates;
             WizardEventArgs.CancelEvent = true;
             if (!string.IsNullOrWhiteSpace(xURLTextBox.Text))
             {
                 if (ValidateFile(xURLTextBox.Text))
                 {
                     WizardEventArgs.CancelEvent = false;
                 }
             }
             else if (XMLTemplatesGrid.DataSourceList != null && XMLTemplatesGrid.DataSourceList.Count > 0)
             {
                 for (int i = 0; i < XMLTemplatesGrid.DataSourceList.Count; i++)
                 {
                     if (ValidateFile(((TemplateFile)XMLTemplatesGrid.DataSourceList[i]).FilePath))
                     {
                         WizardEventArgs.CancelEvent = false;
                     }
                     else
                     {
                         WizardEventArgs.CancelEvent = true;
                         break;
                     }
                 }
             }
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.JsonTemplate.ToString())
         {
             AddAPIModelWizard.APIType   = eAPIType.JsonTemplate;
             WizardEventArgs.CancelEvent = true;
             if (!string.IsNullOrWhiteSpace(xURLTextBox.Text))
             {
                 if (ValidateFile(xURLTextBox.Text))
                 {
                     WizardEventArgs.CancelEvent = false;
                 }
             }
             else if (XMLTemplatesGrid.DataSourceList != null && XMLTemplatesGrid.DataSourceList.Count > 0)
             {
                 for (int i = 0; i < XMLTemplatesGrid.DataSourceList.Count; i++)
                 {
                     if (ValidateFile(((TemplateFile)XMLTemplatesGrid.DataSourceList[i]).FilePath))
                     {
                         WizardEventArgs.CancelEvent = false;
                     }
                     else
                     {
                         WizardEventArgs.CancelEvent = true;
                         break;
                     }
                 }
             }
         }
         else if (APITypeComboBox.SelectedValue.ToString() == eAPIType.Swagger.ToString())
         {
             AddAPIModelWizard.APIType   = eAPIType.Swagger;
             WizardEventArgs.CancelEvent = true;
             if (!string.IsNullOrWhiteSpace(xURLTextBox.Text))
             {
                 if (ValidateFile(xURLTextBox.Text))
                 {
                     WizardEventArgs.CancelEvent = false;
                 }
             }
         }
     }
 }