private void ShowPanel(WizardPanel panel)
 {
     if (this._panelHistory.Count == 1)
     {
         this.PreviousButton.Enabled = false;
     }
     else
     {
         this.PreviousButton.Enabled = true;
     }
     if (panel.NextPanel == null)
     {
         this.NextButton.Enabled = false;
     }
     else
     {
         this.NextButton.Enabled = true;
     }
     panel.Show();
     base.AccessibleDescription = panel.Caption;
     base.CaptionLabel.Text     = panel.Caption;
     if (base.IsHandleCreated)
     {
         base.Invalidate();
     }
     panel.Focus();
 }
 internal static WizardPanel CreateCommandPanel(SqlDataSourceWizardForm wizard, DesignerDataConnection dataConnection, WizardPanel nextPanel)
 {
     IDataEnvironment service = null;
     IServiceProvider site = wizard.SqlDataSourceDesigner.Component.Site;
     if (site != null)
     {
         service = (IDataEnvironment) site.GetService(typeof(IDataEnvironment));
     }
     bool flag = false;
     if (service != null)
     {
         try
         {
             IDesignerDataSchema connectionSchema = service.GetConnectionSchema(dataConnection);
             if (connectionSchema != null)
             {
                 flag = connectionSchema.SupportsSchemaClass(DesignerDataSchemaClass.Tables);
                 if (flag)
                 {
                     connectionSchema.GetSchemaItems(DesignerDataSchemaClass.Tables);
                 }
                 else
                 {
                     flag = connectionSchema.SupportsSchemaClass(DesignerDataSchemaClass.Views);
                     connectionSchema.GetSchemaItems(DesignerDataSchemaClass.Views);
                 }
             }
         }
         catch (Exception exception)
         {
             UIServiceHelper.ShowError(site, exception, System.Design.SR.GetString("SqlDataSourceConnectionPanel_CouldNotGetConnectionSchema"));
             return null;
         }
     }
     if (nextPanel == null)
     {
         if (flag)
         {
             return wizard.GetConfigureSelectPanel();
         }
         return CreateCustomCommandPanel(wizard, dataConnection);
     }
     if (flag)
     {
         if (nextPanel is SqlDataSourceConfigureSelectPanel)
         {
             return nextPanel;
         }
         return wizard.GetConfigureSelectPanel();
     }
     if (nextPanel is SqlDataSourceCustomCommandPanel)
     {
         return nextPanel;
     }
     return CreateCustomCommandPanel(wizard, dataConnection);
 }
 internal void RegisterPanel(WizardPanel panel)
 {
     if (!base.TaskPanel.Controls.Contains(panel))
     {
         panel.Dock = DockStyle.Fill;
         panel.SetParentWizard(this);
         panel.Hide();
         base.TaskPanel.Controls.Add(panel);
     }
 }
 public void PreviousPanel()
 {
     if (this._panelHistory.Count > 1)
     {
         WizardPanel currentPanel = this._panelHistory.Pop();
         WizardPanel panel        = this._panelHistory.Peek();
         currentPanel.OnPrevious();
         currentPanel.Hide();
         this.OnPanelChanging(new WizardPanelChangingEventArgs(currentPanel));
         this.ShowPanel(panel);
     }
 }
 protected void SetPanels(WizardPanel[] panels)
 {
     if ((panels != null) && (panels.Length > 0))
     {
         this.RegisterPanel(panels[0]);
         this._initialPanel = panels[0];
         for (int i = 0; i < (panels.Length - 1); i++)
         {
             this.RegisterPanel(panels[i + 1]);
             panels[i].NextPanel = panels[i + 1];
         }
     }
 }
        public void NextPanel()
        {
            WizardPanel currentPanel = this._panelHistory.Peek();

            if (currentPanel.OnNext())
            {
                currentPanel.Hide();
                WizardPanel nextPanel = currentPanel.NextPanel;
                if (nextPanel != null)
                {
                    this.RegisterPanel(nextPanel);
                    this._panelHistory.Push(nextPanel);
                    this.OnPanelChanging(new WizardPanelChangingEventArgs(currentPanel));
                    this.ShowPanel(nextPanel);
                }
            }
        }
 private void ShowPanel(WizardPanel panel)
 {
     if (this._panelHistory.Count == 1)
     {
         this.PreviousButton.Enabled = false;
     }
     else
     {
         this.PreviousButton.Enabled = true;
     }
     if (panel.NextPanel == null)
     {
         this.NextButton.Enabled = false;
     }
     else
     {
         this.NextButton.Enabled = true;
     }
     panel.Show();
     base.AccessibleDescription = panel.Caption;
     base.CaptionLabel.Text = panel.Caption;
     if (base.IsHandleCreated)
     {
         base.Invalidate();
     }
     panel.Focus();
 }
 protected void SetPanels(WizardPanel[] panels)
 {
     if ((panels != null) && (panels.Length > 0))
     {
         this.RegisterPanel(panels[0]);
         this._initialPanel = panels[0];
         for (int i = 0; i < (panels.Length - 1); i++)
         {
             this.RegisterPanel(panels[i + 1]);
             panels[i].NextPanel = panels[i + 1];
         }
     }
 }
 internal void RegisterPanel(WizardPanel panel)
 {
     if (!base.TaskPanel.Controls.Contains(panel))
     {
         panel.Dock = DockStyle.Fill;
         panel.SetParentWizard(this);
         panel.Hide();
         base.TaskPanel.Controls.Add(panel);
     }
 }
Пример #10
0
 public WizardPanelChangingEventArgs(WizardPanel currentPanel)
 {
     this._currentPanel = currentPanel;
 }
 public WizardPanelChangingEventArgs(WizardPanel currentPanel)
 {
     this._currentPanel = currentPanel;
 }