Exemple #1
0
        /// <summary>
        /// Called when the substates has changing.
        /// </summary>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected virtual void OnActiveSubstateChanging(ActiveSubstateChangingEventArgs e)
        {
            EventHandler <ActiveSubstateChangingEventArgs> handler = this.ActiveSubstateChanging;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemple #2
0
        /// <summary>
        /// Handles the OnCheckedChanged event of the Substate control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Substate_OnCheckedChanged(object sender, System.EventArgs e)
        {
            if ((this.CurrentState != null) && (this.CurrentState.Substates != null) && (!this.ReadOnly))
            {
                System.Web.UI.WebControls.CheckBox substateCheckBox = (System.Web.UI.WebControls.CheckBox)sender;
                Substate substate = this.CurrentState.Substates.Single(s => s.Code == substateCheckBox.ID);
                ActiveSubstateChangingEventArgs eventArgs = new ActiveSubstateChangingEventArgs(substate, substateCheckBox.Checked);

                this.DisableSubstateAnimation = true;

                this.OnActiveSubstateChanging(eventArgs);
                if (!eventArgs.Cancel)
                {
                    substate.Active = substateCheckBox.Checked;
                    this.OnActiveSubstateChanged(new ActiveSubstateChangedEventArgs(substate));
                }
            }
        }
        /// <summary>
        /// Handles the OnCheckedChanged event of the Substate control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Substate_OnCheckedChanged(object sender, System.EventArgs e)
        {
            if ((this.CurrentState != null) && (this.CurrentState.Substates != null) && (!this.ReadOnly))
              {
            System.Web.UI.WebControls.CheckBox substateCheckBox = (System.Web.UI.WebControls.CheckBox)sender;
            Substate substate = this.CurrentState.Substates.Single(s => s.Code == substateCheckBox.ID);
            ActiveSubstateChangingEventArgs eventArgs = new ActiveSubstateChangingEventArgs(substate, substateCheckBox.Checked);

            this.DisableSubstateAnimation = true;

            this.OnActiveSubstateChanging(eventArgs);
            if (!eventArgs.Cancel)
            {
              substate.Active = substateCheckBox.Checked;
              this.OnActiveSubstateChanged(new ActiveSubstateChangedEventArgs(substate));
            }
              }
        }
        /// <summary>
        /// Called when the substates has changing.
        /// </summary>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected virtual void OnActiveSubstateChanging(ActiveSubstateChangingEventArgs e)
        {
            EventHandler<ActiveSubstateChangingEventArgs> handler = this.ActiveSubstateChanging;

              if (handler != null)
              {
            handler(this, e);
              }
        }