/// <summary> /// Gets the checked/unchecked state of a radio button /// </summary> /// <param name="button">The radio button to get the checked/unchecked of.</param> /// <returns>True if the radio button is checked, false otherwise.</returns> public bool GetRadioState(WizardButton button) { RadioButton rb = this.FindButton(button) as RadioButton; Debug.Assert(rb != null, "Could not find the control"); return(rb.Checked); }
/// <summary> /// Sets the wizard radio button to be checked or not /// </summary> /// <param name="button">The button for which the checked value is to be set.</param> /// <param name="check">The checked/unchecked status to set.</param> public void SetRadioState(WizardButton button, bool check) { RadioButton rb = this.FindButton(button) as RadioButton; Debug.Assert(rb != null, "Could not find the control"); rb.Checked = check; }
private void wizDBSelect1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Next) { ///Levanta el segundo wizard using(frmWizEntity_2 frm = new frmWizEntity_2 (wizDBSelect1.Cnn)) { frm.ProjectName = this.ProjectName; //Creo el manejador de para detectar la finalizacion frm.FinalizeWizEvent += new FinalizeWizHandler(frmWizEntity_2_FinalizeWizEvent); frm.ShowDialog(); } return; } if (result == WizardButton.Cancel) { this.OnFinalizeWiz(WizardButton.Cancel); } }
/// <summary> /// Enables or disables a button. /// </summary> /// <param name="button">The button to set the status of.</param> /// <param name="enabled">True to enable the button, false otherwise.</param> public void SetButtonState(WizardButton button, bool enabled) { Control c = this.FindButton(button); Debug.Assert(c != null, "Could not find the control"); c.Enabled = enabled; }
private void wizTablesTreeSelector1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Ok) { List <MethodActionType> wMethodActionTypeList = new List <MethodActionType>(); if (chkInsert.Checked) { wMethodActionTypeList.Add(MethodActionType.Insert); } if (chkUpdate.Checked) { wMethodActionTypeList.Add(MethodActionType.Update); } if (chkSearchByParams.Checked) { wMethodActionTypeList.Add(MethodActionType.SearchByParam); } if (chkDelete.Checked) { wMethodActionTypeList.Add(MethodActionType.Delete); } this.GenCode = new Dictionary <string, string>(); this.GenCode.Add(string.Concat(wizTablesTreeSelector1.SelectedTable.Name, "DAC.cs") , GenDAC.Gen_DAC(wizTablesTreeSelector1.SelectedTable, wMethodActionTypeList, chkBatch.Checked, this.ProjectName)); } this.OnFinalizeWiz(this.WizardButton); }
protected void OnFinalizeWiz(WizardButton pWizardButton) { if (this.FinalizeWizEvent != null) { FinalizeWizEvent(this, pWizardButton); } }
/// <summary> /// Returns the enabled/disabled status of a button. /// </summary> /// <param name="button">The button to get the status of.</param> /// <returns>True if the button is enabled, false otherwise.</returns> public bool GetButtonState(WizardButton button) { Control c = this.FindButton(button); Debug.Assert(c != null, "Could not find the control"); return(c.Enabled); }
/// <summary> /// Checks the state of a button. /// </summary> /// <param name="button">The button to check.</param> private void CheckButtonState(WizardButton button) { if (!this.view.GetButtonState(button)) { throw new InvalidOperationException(ErrorMessages.ButtonStateInconsistency); } }
public void DoEvent(object o, WizardButton r) { if (OnWizardButtonClickEvent != null) { OnWizardButtonClickEvent(o, r); } }
private void wizTablesTreeSelector1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Ok) { List<MethodActionType> wMethodActionTypeList = new List<MethodActionType>(); if (chkInsert.Checked) wMethodActionTypeList.Add(MethodActionType.Insert); if (chkUpdate.Checked) wMethodActionTypeList.Add(MethodActionType.Update); if (chkSearchByParams.Checked) wMethodActionTypeList.Add(MethodActionType.SearchByParam); if (chkDelete.Checked) wMethodActionTypeList.Add(MethodActionType.Delete); this.GenCode = new Dictionary<string, string>(); this.GenCode.Add(string.Concat(wizTablesTreeSelector1.SelectedTable.Name, "DAC.cs") , GenDAC.Gen_DAC(wizTablesTreeSelector1.SelectedTable, wMethodActionTypeList, chkBatch.Checked, this.ProjectName)); } this.OnFinalizeWiz(this.WizardButton); }
/// <summary> /// Enables or disables the Back, Next, or Finish buttons in the /// wizard. /// </summary> /// <param name="flags"> /// A set of flags that customize the function and appearance of the /// wizard buttons. This parameter can be a combination of any /// value in the <c>WizardButton</c> enumeration. /// </param> /// <remarks> /// Typically, you should call <c>SetWizardButtons</c> from /// <c>WizardPage.OnSetActive</c>. You can display a Finish or a /// Next button at one time, but not both. /// </remarks> public void SetWizardButtons(WizardButton flags) { // Enable/disable and show/hide buttons appropriately m_backButton.Enabled = (flags & WizardButton.Back) == WizardButton.Back; m_backButton.Visible = (flags & WizardButton.Back) == WizardButton.Back; m_nextButton.Enabled = (flags & WizardButton.Next) == WizardButton.Next; m_nextButton.Visible = (flags & WizardButton.Finish) == 0 && (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Enabled = (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Visible = (flags & WizardButton.Finish) == WizardButton.Finish || (flags & WizardButton.DisabledFinish) == WizardButton.DisabledFinish; m_cancelButton.Enabled = (m_backButton.Enabled || m_nextButton.Enabled); m_cancelButton.Visible = (!m_finishButton.Visible || !m_finishButton.Enabled); if (flags == WizardButton.DisabledAll) { m_backButton.Visible = m_nextButton.Visible = m_cancelButton.Visible = true; m_backButton.Enabled = m_nextButton.Enabled = m_cancelButton.Enabled = false; m_finishButton.Visible = m_finishButton.Enabled = false; } // Set the AcceptButton depending on whether or not the Finish // button is visible or not //AcceptButton = m_finishButton.Visible ? m_finishButton : m_nextButton; }
public void SetRadioState(WizardButton button, bool check) { this.radioButtonState[button.ToString()] = check; if (button == WizardButton.ChooseExecutable && check) { this.wizardController.ChooseExecutableOptions(ActionDirection.FromView); } if (button == WizardButton.ChooseTraceFile && check) { this.wizardController.ChooseTraceFileOptions(ActionDirection.FromView); } if (button == WizardButton.ChooseWcfClientTrace && check) { this.wizardController.ChooseWcfClientTraceFile(ActionDirection.FromView); } if (button == WizardButton.ChooseWcfServerTrace && check) { this.wizardController.ChooseWcfServerTraceFile(ActionDirection.FromView); } if (button == WizardButton.ChooseFiddlerTextTrace && check) { this.wizardController.ChooseFiddlerTextTraceFile(ActionDirection.FromView); } }
private void ctrlNewService1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Ok) { //this.GenCode = ctrlNewService1.ServiceName; } this.OnFinalizeWiz(WizardButton); this.Close(); }
/// <summary> /// Creates the wizard button. /// </summary> /// <param name="title">The title.</param> /// <param name="action">The action.</param> /// <param name="canExecute">The can execute.</param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">title</exception> public IWizardButton CreateWizardButton(string title, Action <object> action, Predicate <object> canExecute = null) { if (string.IsNullOrWhiteSpace(title)) { throw new ArgumentNullException("title"); } var command = new RelayCommand(action, canExecute); var button = new WizardButton(title, command); return(button); }
void frmWizEntity_2_FinalizeWizEvent(frmWizBase frm, WizardButton pWizardButton) { this.WizardButton = pWizardButton; this.Cnn = wizDBSelect1.Cnn; if (frm.WizardButton == WizardButton.Ok) { this.GenCode = frm.GenCode; this.OnFinalizeWiz(this.WizardButton); } if (pWizardButton == WizardButton.Cancel) { this.OnFinalizeWiz(this.WizardButton); } frm.Close(); }
private void wizTablesTreeSelector1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Ok) { List <Table> list = (List <Table>)arg; if (list.Count == 0) { MessageBox.Show("Debe chequear al menos una tabla"); wizTablesTreeSelector1.Focus(); return; } this.GenCode = GenEntity.GenerateEntities(list, this.ProjectName); } this.OnFinalizeWiz(WizardButton); }
public void SetWizardButtons(WizardButton flags) { // Enable/disable and show/hide buttons appropriately m_backButton.Enabled = (flags & WizardButton.Back) == WizardButton.Back; m_nextButton.Enabled = (flags & WizardButton.Next) == WizardButton.Next; m_nextButton.Visible = (flags & WizardButton.Finish) == 0 && (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Enabled = (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Visible = (flags & WizardButton.Finish) == WizardButton.Finish || (flags & WizardButton.DisabledFinish) == WizardButton.DisabledFinish; }
void frmWizEntity_2_FinalizeWizEvent(frmWizBase frm, WizardButton pWizardButton) { this.WizardButton = pWizardButton; this.Cnn = this.wizDBSelect1.Cnn; if (frm.WizardButton == WizardButton.Ok) { this.GenCode = frm.GenCode; this.OnFinalizeWiz(WizardButton.Ok); } if (pWizardButton == WizardButton.Cancel) { this.OnFinalizeWiz(this.WizardButton); } frm.Close(); }
public void SetButtonLabel(WizardButton button, string label) { switch (button) { case WizardButton.Cancel: this.buttonCancel.Text = label; break; case WizardButton.Next: this.buttonNext.Text = label; break; case WizardButton.Prev: this.buttonCancel.Text = label; break; } }
public void SetButtonState(WizardButton button, bool state) { switch (button) { case WizardButton.Cancel: this.buttonCancel.Enabled = state; break; case WizardButton.Next: this.buttonNext.Enabled = state; break; case WizardButton.Prev: this.buttonPrev.Enabled = state; break; } }
private void wizardControlImportUser_CustomizeCommandButtons(object sender, DevExpress.XtraWizard.CustomizeCommandButtonsEventArgs e) { if (!string.IsNullOrWhiteSpace(e.Page.Name)) { e.FinishButton.Visible = true; e.FinishButton.Location = new Point(e.CancelButton.Location.X - (e.FinishButton.Size.Width + 5), e.FinishButton.Location.Y); e.FinishButton.Button.Enabled = importSuccessful; finishButton = e.FinishButton.Button; e.NextButton.Location = new Point(e.FinishButton.Location.X - (e.NextButton.Size.Width + 5), e.NextButton.Location.Y); e.PrevButton.Location = new Point(e.NextButton.Location.X - (e.PrevButton.Size.Width + 5), e.PrevButton.Location.Y); if (e.Page == wizardPageDataPreview) { e.NextButton.Visible = true; e.NextButton.Button.Enabled = true; } e.NextButton.Button.Focus(); } }
public void PerformButtonFunc(WizardButton typ) { switch (typ) { case WizardButton.Back: ShowPage(GetPage() - 1); break; case WizardButton.Cancel: DialogResult re = MessageBox.Show("Are you sure you want to exit the wizard?\n\nYou must run this wizard to fully configure\nthe program!", "Abort?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (re == System.Windows.Forms.DialogResult.Yes) { Program.ForceQuit(); } break; case WizardButton.Finish: SettingsManager.PrimarySettings["first_time"] = false; SettingsManager.PrimarySettings["languagepack"] = lPack; SettingsManager.Save(); Application.Restart(); return; case WizardButton.Next: if (GetPage() == 2) { LanguageManager.Current = LanguageManager.Packs[lPack]; initlanguage(); wizardPageCollection1.TabPages[2].Tag = true; } ShowPage(GetPage() + 1); if (GetPage() == wizardPageCollection1.TabPages.Count) { wizardPageCollection1.TabPages[wizardPageCollection1.TabPages.Count - 1].Tag = true; } break; } wizardPageCollection1.UpdateButtons(); }
private void wizTablesTreeSelector1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Ok) { List<Table> list = (List<Table>)arg; if (list.Count == 0) { MessageBox.Show("Debe chequear al menos una tabla"); wizTablesTreeSelector1.Focus(); return; } this.GenCode = GenEntity.GenerateEntities(list, this.ProjectName); } this.OnFinalizeWiz(WizardButton); }
public void SetButtonVisibility(WizardButton button, bool state) { switch (button) { case WizardButton.Finish: this.buttonFinish.Visible = state; break; case WizardButton.Cancel: this.buttonCancel.Visible = state; break; case WizardButton.Next: this.buttonNext.Visible = state; break; case WizardButton.Prev: this.buttonPrev.Visible = state; break; } }
/// <summary> /// Enables or disables the Back, Next, or Finish buttons in the /// wizard. /// </summary> /// <param name="flags"> /// A set of flags that customize the function and appearance of the /// wizard buttons. This parameter can be a combination of any /// value in the <c>WizardButton</c> enumeration. /// </param> /// <remarks> /// Typically, you should call <c>SetWizardButtons</c> from /// <c>WizardPage.OnSetActive</c>. You can display a Finish or a /// Next button at one time, but not both. /// </remarks> public void SetWizardButtons(WizardButton flags) { // Enable/disable and show/hide buttons appropriately m_backButton.Enabled = (flags & WizardButton.Back) == WizardButton.Back; m_nextButton.Enabled = (flags & WizardButton.Next) == WizardButton.Next; m_nextButton.Visible = (flags & WizardButton.Finish) == 0 && (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Enabled = (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Visible = (flags & WizardButton.Finish) == WizardButton.Finish || (flags & WizardButton.DisabledFinish) == WizardButton.DisabledFinish; // Set the AcceptButton depending on whether or not the Finish // button is visible or not AcceptButton = m_finishButton.Visible ? m_finishButton : m_nextButton; }
private void wizDBSelect1_OnWizardButtonClickEvent(object arg, WizardButton result) { this.WizardButton = result; if (result == WizardButton.Next) { ///Levanta el segundo wizard using (frmWizDAC_2 frm = new frmWizDAC_2(wizDBSelect1.Cnn)) { //Creo el manejador de para detectar la finalizacion frm.FinalizeWizEvent += new FinalizeWizHandler(frmWizEntity_2_FinalizeWizEvent); frm.ProjectName = this.ProjectName; frm.ShowDialog(); } return; } if (result == WizardButton.Cancel) { this.OnFinalizeWiz(WizardButton.Cancel); } }
public void SetButtonState(WizardButton button, bool enabled) { this.buttonState[button.ToString()] = enabled; }
public bool GetRadioState(WizardButton button) { return(this.radioButtonState[button.ToString()]); }
private void OnStartUpgrade() { IsInUpgrading = true; string upgradeDescription = string.Empty; string stepDes = Translator.GetValue("Working on updates\nPart 4 of 4: Upgrading to new version"); try { string destAssembly = Path.Combine(_upgradeFolder, "UpgradeHost.DLL"); if (!File.Exists(destAssembly) || !DigitalSignatureChecker.VerifySignature(destAssembly)) { throw new Exception(); } UpgradeProxy proxy = new UpgradeProxy(destAssembly); upgradeDescription = proxy.Description(); _wizardService.UpdateStates(_title, upgradeDescription, stepDes, DoNotTrunOff); string message; if (!proxy.CanExecute(out message)) { throw new Exception(message); } try { Thread.Sleep(2000); proxy.Execute(_upgradeFolder, out message); } catch (Exception e) { throw new Exception(e.InnerException != null?e.InnerException.Message:e.Message); } try { //delete upgrade folder //todo KnowIssue ,UpgradeHost.dll can't be delete,as it has been loaded into AppDomain Directory.Delete(_upgradeFolder, true); } catch (Exception e) { } const string shutdownMessage = "Upgrade done successfully.\nSystem will continue automatically after"; string shutdownAdditionDes = string.Empty; var buttons = new WizardButton[1]; buttons[0] = new WizardButton(WizardButtonEnum.Ok, null, "Continue"); int timeoutTicks = ResourceManager.GetValue("Upgrade", "TimeoutTicks", 10); _wizardService.UpdateStates(_title, upgradeDescription, shutdownMessage, shutdownAdditionDes, -1, true, buttons, timeoutTicks, buttons[0]); //Decide to start Main.exe or continue upgrade. StartOrContinue(); } catch (Exception e) { var buttons = new WizardButton[1]; buttons[0] = new WizardButton(WizardButtonEnum.Ok, null, "Shut Down"); _wizardService.UpdateStates(_title, upgradeDescription, Translator.GetValue("Upgrade failed.\nSystem will shut down."), e.Message, -1, true, buttons); HostManager.ShutDown(RestartType.ShutdownOS); } finally { IsInUpgrading = false; HostManager.ShutDown(RestartType.None); } }
void inputForm_FinalizeWizEvent(frmWizBase frm, WizardButton pWizardButton) { _Storage.CnnString = inputForm.Cnn; _Storage.SaveStorage(); frm.Close(); }
void inputForm_FinalizeWizEvent(frmWizBase frm, WizardButton pWizardButton) { frm.Close(); }
protected void OnFinalizeWiz(WizardButton pWizardButton) { if(this.FinalizeWizEvent!= null) FinalizeWizEvent(this,pWizardButton); }
public void DoEvent(object o, WizardButton r) { if (OnWizardButtonClickEvent != null) OnWizardButtonClickEvent(o,r); }
public void SelectWizard() { gameManger.party.PlayerParty.Add(Wizard); WizardButton.SetActive(false); }
/// <summary> /// Enables or disables the Back, Next, or Finish buttons in the /// wizard. /// </summary> /// <param name="flags"> /// A set of flags that customize the function and appearance of the /// wizard buttons. This parameter can be a combination of any /// value in the <c>WizardButton</c> enumeration. /// </param> /// <remarks> /// Typically, you should call <c>SetWizardButtons</c> from /// <c>WizardPage.OnSetActive</c>. You can display a Finish or a /// Next button at one time, but not both. /// </remarks> public void SetWizardButtons( WizardButton flags ) { // Enable/disable and show/hide buttons appropriately m_backButton.Enabled = (flags & WizardButton.Back) == WizardButton.Back; m_nextButton.Enabled = (flags & WizardButton.Next) == WizardButton.Next; m_nextButton.Visible = (flags & WizardButton.Finish) == 0 && (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Enabled = (flags & WizardButton.DisabledFinish) == 0; m_finishButton.Visible = (flags & WizardButton.Finish) == WizardButton.Finish || (flags & WizardButton.DisabledFinish) == WizardButton.DisabledFinish; // Set the AcceptButton depending on whether or not the Finish // button is visible or not AcceptButton = m_finishButton.Visible ? m_finishButton : m_nextButton; }
/// <summary> /// Finds a button. /// </summary> /// <param name="button">The button to find.</param> /// <returns>The button.</returns> private Control FindButton(WizardButton button) { string tag = GetButtonTag(button); return(this.FindControl(this, tag)); }
public WizardButtonClickEventArgs(WizardButton clickedButton) { this.Cancel = false; this._Button = clickedButton; }