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 LinkClicked event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected virtual void OnLinkClicked(LinkClickedEventArgs e)
        {
            if (LinkClicked != null)
            {
                LinkClicked(this, e);
            }

            // If we have an attached command then execute it
            if (KryptonCommand != null)
            {
                KryptonCommand.PerformExecute();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Generates the Click event.
        /// </summary>
        /// <param name="e">An EventArgs containing the event data.</param>
        protected void GenerateClick(EventArgs e)
        {
            if (Click != null)
            {
                Click(this, e);
            }

            // If we have an attached command then execute it
            if (KryptonCommand != null)
            {
                KryptonCommand.PerformExecute();
            }
        }
Ejemplo n.º 4
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.º 5
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
            if (KryptonCommand != null)
            {
                KryptonCommand.PerformExecute();
            }
        }