/// <summary> /// Sets the button style specified /// </summary> /// <param name="style"></param> public void SetButtonStyle(WizardButtonStyle style) { switch (style.Button) { case WizardButtons.Help: _buttonHelp.SetStyle(style); break; case WizardButtons.Back: _buttonBack.SetStyle(style); break; case WizardButtons.Next: _buttonNext.SetStyle(style); break; case WizardButtons.Finish: _buttonNext.SetStyle(style); break; case WizardButtons.Cancel: _buttonCancel.SetStyle(style); break; } ; }
public void Remove(WizardButtonStyle buttonStyle) { if (this.Contains(buttonStyle)) { base.InnerList.Remove(buttonStyle); } }
public void Add(WizardButtonStyle buttonStyle) { if (!this.Contains(buttonStyle)) { base.InnerList.Add(buttonStyle); } }
public bool Contains(WizardButtonStyle buttonStyle) { foreach (WizardButtonStyle bs in base.InnerList) { if (bs.Button == buttonStyle.Button) { return(true); } } return(false); }
/// <summary> /// Evaluates the flags for true (OR) and sets the appropriate style based on the result /// </summary> /// <param name="styleIfTrue">The style to set if the result is True</param> /// <param name="styleIfFalse">The style to set if the result is False</param> /// <param name="flags">The flags that will be evaluated to determine if any are true. Only one must be True to evaluate to True.</param> public bool SetButtonStyleIfAnyAreTrue(WizardButtonStyle styleIfTrue, WizardButtonStyle styleIfFalse, params bool[] flags) { // evaluate the flags, all must be true to pass bool styleIsTrue = false; foreach (bool flag in flags) { if (flag == true) { // if even one is true then bail out and use the styleIfTrue style styleIsTrue = true; break; } } // set the appropriate button style this.Wizard.SetButtonStyle((styleIsTrue ? styleIfTrue : styleIfFalse)); return(styleIsTrue); // return the result of this, it will be used frequently to control path selection }
/// <summary> /// Applies the specified style to the button /// </summary> /// <param name="style"></param> public void SetStyle(WizardButtonStyle style) { switch (style.Button) { case WizardButtons.Help: case WizardButtons.Back: case WizardButtons.Next: case WizardButtons.Finish: case WizardButtons.Cancel: this.Text = style.Button.ToString(); break; case WizardButtons.None: default: this.Text = null; break; } ; this._button = style.Button; this.Visible = style.Visible; this.Enabled = style.Enabled; }
/// <summary> /// Evaluates the flags for true (OR) and sets the appropriate style based on the result /// </summary> /// <param name="styleIfTrue">The style to set if the result is True</param> /// <param name="styleIfFalse">The style to set if the result is False</param> /// <param name="flags">The flags that will be evaluated to determine if any are true. Only one must be True to evaluate to True.</param> public bool SetButtonStyleIfAnyAreTrue(WizardButtonStyle styleIfTrue, WizardButtonStyle styleIfFalse, params bool[] flags) { // evaluate the flags, all must be true to pass bool styleIsTrue = false; foreach(bool flag in flags) if (flag == true) { // if even one is true then bail out and use the styleIfTrue style styleIsTrue = true; break; } // set the appropriate button style this.Wizard.SetButtonStyle((styleIsTrue ? styleIfTrue : styleIfFalse)); return styleIsTrue; // return the result of this, it will be used frequently to control path selection }
public bool Contains(WizardButtonStyle buttonStyle) { foreach(WizardButtonStyle bs in base.InnerList) if (bs.Button == buttonStyle.Button) return true; return false; }
public void Remove(WizardButtonStyle buttonStyle) { if (this.Contains(buttonStyle)) base.InnerList.Remove(buttonStyle); }
public void Add(WizardButtonStyle buttonStyle) { if (!this.Contains(buttonStyle)) base.InnerList.Add(buttonStyle); }
/// <summary> /// Sets the button style specified /// </summary> /// <param name="style"></param> public void SetButtonStyle(WizardButtonStyle style) { switch(style.Button) { case WizardButtons.Help: _buttonHelp.SetStyle(style); break; case WizardButtons.Back: _buttonBack.SetStyle(style); break; case WizardButtons.Next: _buttonNext.SetStyle(style); break; case WizardButtons.Finish: _buttonNext.SetStyle(style); break; case WizardButtons.Cancel: _buttonCancel.SetStyle(style); break; }; }
/// <summary> /// Initializes a new instance of the WizardPageButtonStyleAttribute class /// </summary> /// <param name="supportedStyles">A combination of styles that the Wizard Page supports</param> public WizardPageButtonStyleAttribute(WizardButtons button, bool visible, bool enabled) : base() { _style = new WizardButtonStyle(button, visible, enabled); }
/// <summary> /// Applies the specified style to the button /// </summary> /// <param name="style"></param> public void SetStyle(WizardButtonStyle style) { switch(style.Button) { case WizardButtons.Help: case WizardButtons.Back: case WizardButtons.Next: case WizardButtons.Finish: case WizardButtons.Cancel: this.Text = style.Button.ToString(); break; case WizardButtons.None: default: this.Text = null; break; }; this._button = style.Button; this.Visible = style.Visible; this.Enabled = style.Enabled; }
/// <summary> /// Initializes a new instance of the WizardPageButtonStyleAttribute class /// </summary> /// <param name="supportedStyles">A combination of styles that the Wizard Page supports</param> public WizardPageButtonStyleAttribute(WizardButtons button, bool visible, bool enabled) : base() { _style = new WizardButtonStyle(button, visible, enabled); }