ComponentFactory.Krypton.Toolkit.KryptonContextMenu.Dispose C# (CSharp) Метод

Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Результат void
        protected override void Dispose(bool disposing)
        {
            if (disposing)
                Close();

            base.Dispose(disposing);
        }

Usage Example

        private void OnKryptonContextMenuClosed(object sender, EventArgs e)
        {
            // Cast to correct type
            KryptonContextMenu kcm = (KryptonContextMenu)sender;

            // Unhook from context menu and dipose of it, we only use each menu instance once
            kcm.Closed -= OnKryptonContextMenuClosed;
            kcm.Dispose();

            // Remove the fixed appearnce of the view button
            _pressedButtonController.RemoveFixed();
            _pressedButtonController = null;

            // No longer showing context menu, so safe to show another one
            _showingContextMenu = false;
        }