public void ConnFinished(string status) { if (this.InvokeRequired) { this.BeginInvoke(new changeText(ConnFinished), status); } else { pingButton.Enabled = true; cmd.HideOpaqueLayer(); if (IPStatus.Success.ToString().Equals(status)) { InfoLabel.Text = "IP地址已被使用,请输入其他IP!"; } else { InfoLabel.Text = "此IP地址可以使用!"; if (Wizard != null) { if (!IsTestPing) { foreach (WizardPage page in Wizard.m_pages) { if ("NetWorkPage" == page.Name) { setNetwork(); Wizard.ActivatePage(Wizard.m_pages.IndexOf(page) + 1); break; } } } } } } }
public void ConnFinished(string info) { if (this.InvokeRequired) { this.BeginInvoke(new changeText(ConnFinished), info); } else { cmd.HideOpaqueLayer(); if (Wizard != null) { Wizard.SetWizardButtons(WizardButton.Back | WizardButton.Next); if (!string.IsNullOrEmpty(info)) { if (info.IndexOf("authenticate") > 0) { testConnectLabel.Text = "用户名或密码错误"; } else { testConnectLabel.Text = info; } } testConnectbutton.Enabled = true; masterLabel.Visible = masterTextBox.Visible = false; if (ConnectManager.IsConn) { if (!IsTestConn) { foreach (WizardPage page in Wizard.m_pages) { if ("HostPage" == page.Name) { Wizard.ActivatePage(Wizard.m_pages.IndexOf(page) + 1); break; } } } } else { string masterHostName = ConnectManager.MasterHostName; if (!String.IsNullOrEmpty(masterHostName)) { masterLabel.Visible = masterTextBox.Visible = true; this.ipBox1.BindTextBox = masterTextBox; masterTextBox.Text = masterHostName; passwordTextBox.Text = ""; testConnectLabel.Text = "请输入管理节点用户密码!"; } } } } }
private void handleAddPage(object sender, EventArgs e) { Wizard wiz = this.Control as Wizard; IDesignerHost h = (IDesignerHost)GetService(typeof(IDesignerHost)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); DesignerTransaction dt = h.CreateTransaction("Add Page"); WizardPage page = (WizardPage)h.CreateComponent(typeof(WizardPage)); c.OnComponentChanging(wiz, null); //Add a new page to the collection wiz.Pages.Add(page); wiz.Controls.Add(page); wiz.ActivatePage(page); c.OnComponentChanged(wiz, null, null, null); dt.Commit(); }