ComponentFactory.Krypton.Ribbon.ViewDrawRibbonGroupDomainUpDown.Dispose C# (CSharp) Method

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_ribbonDomainUpDown != null)
                {
                    // Must unhook to prevent memory leaks
                    _ribbonDomainUpDown.MouseEnterControl -= new EventHandler(OnMouseEnterControl);
                    _ribbonDomainUpDown.MouseLeaveControl -= new EventHandler(OnMouseLeaveControl);
                    _ribbonDomainUpDown.ViewPaintDelegate = null;
                    _ribbonDomainUpDown.PropertyChanged -= new PropertyChangedEventHandler(OnDomainUpDownPropertyChanged);
                    _ribbon.ViewRibbonManager.LayoutAfter -= new EventHandler(OnLayoutAction);
                    _ribbon.ViewRibbonManager.LayoutBefore -= new EventHandler(OnLayoutAction);

                    // Remove association with definition
                    _ribbonDomainUpDown.DomainUpDownView = null;
                    _ribbonDomainUpDown = null;
                }
            }

            base.Dispose(disposing);
        }