ComponentFactory.Krypton.Toolkit.VisualControlBase.UpdateGlobalEvents C# (CSharp) Method

UpdateGlobalEvents() protected method

Update global event attachments.
protected UpdateGlobalEvents ( bool attach ) : void
attach bool True if attaching; otherwise false.
return void
        protected virtual void UpdateGlobalEvents(bool attach)
        {
            if (attach)
            {
                KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged);
                SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
            }
            else
            {
                KryptonManager.GlobalPaletteChanged -= new EventHandler(OnGlobalPaletteChanged);
                SystemEvents.UserPreferenceChanged -= new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
            }
        }