Ejemplo n.º 1
0
        /// <summary>
        /// Raises the CheckStateChanged event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected override void OnClick(EventArgs e)
        {
            if (AutoCheck)
            {
                // Change state based on the current state
                switch (CheckState)
                {
                case CheckState.Unchecked:
                    CheckState = CheckState.Checked;
                    break;

                case CheckState.Checked:
                    CheckState = (ThreeState ? CheckState.Indeterminate : CheckState.Unchecked);
                    break;

                case CheckState.Indeterminate:
                    CheckState = CheckState.Unchecked;
                    break;
                }
            }

            base.OnClick(e);

            // If we have an attached command then execute it
            if (KryptonCommand != null)
            {
                KryptonCommand.PerformExecute();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the Click event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected virtual void OnClick(EventArgs e)
        {
            Click?.Invoke(this, e);

            // If we have an attached command then execute it
            KryptonCommand?.PerformExecute();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Raises the Click event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected virtual void OnClick(EventArgs e)
        {
            // Only if associated view is enabled do we perform the click
            if (GetViewEnabled())
            {
                Click?.Invoke(this, e);

                // If we have an attached command then execute it
                KryptonCommand?.PerformExecute();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Raises the Click event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected virtual void OnClick(EventArgs e)
        {
            if (Click != null)
            {
                Click(this, e);
            }

            // If we have an attached command then execute it
            if (KryptonCommand != null)
            {
                KryptonCommand.PerformExecute();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Raises the Click event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected virtual void OnClick(EventArgs e)
        {
            // Only if associated view is enabled do we perform the click
            if (GetViewEnabled())
            {
                if (Click != null)
                {
                    Click(this, e);
                }

                // If we have an attached command then execute it
                if (KryptonCommand != null)
                {
                    KryptonCommand.PerformExecute();
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Raises the Click event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnClick(EventArgs e)
        {
            // Find the form this button is on
            Form owner = FindForm();

            // If we find a valid owner
            if (owner != null)
            {
                // Update owner with our dialog result setting
                owner.DialogResult = DialogResult;
            }

            // Let base class fire standard event
            base.OnClick(e);

            // If we have an attached command then execute it
            KryptonCommand?.PerformExecute();
        }