コード例 #1
0
        /// <summary>
        /// Raises the Removing event.
        /// </summary>
        /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param>
        protected override void OnRemoving(TypedCollectionEventArgs <KryptonContextMenuItemBase> e)
        {
            // Must unhook from the change event to prevent memory leak
            if (e.Item is KryptonContextMenuRadioButton radioButton)
            {
                radioButton.CheckedChanged -= OnRadioButtonCheckedChanged;
            }

            base.OnRemoving(e);
        }
コード例 #2
0
        /// <summary>
        /// Raises the Inserted event.
        /// </summary>
        /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param>
        protected override void OnInserted(TypedCollectionEventArgs <KryptonContextMenuItemBase> e)
        {
            base.OnInserted(e);

            // We monitor changes to the checked state of radio buttons
            if (e.Item is KryptonContextMenuRadioButton radioButton)
            {
                radioButton.CheckedChanged += OnRadioButtonCheckedChanged;
            }
        }