ComponentFactory.Krypton.Toolkit.VisualContainerControlBase.VisualContainerControlBase C# (CSharp) Method

VisualContainerControlBase() protected method

Initialize a new instance of the VisualContainerControlBase class.
protected VisualContainerControlBase ( ) : System
return System
        protected VisualContainerControlBase()
        {
            #region Default ControlStyle Values
            // Default style values for Control are:-
            //	True  - AllPaintingInWmPaint
            //	False - CacheText
            //	False - ContainerControl
            //	False - EnableNotifyMessage
            //	False - FixedHeight
            //	False - FixedWidth
            //	False - Opaque
            //	False - OptimizedDoubleBuffer
            //	False - ResizeRedraw
            //	True  - Selectable
            //	True  - StandardClick
            //	True  - StandardDoubleClick
            //	False - SupportsTransparentBackColor
            //	False - UserMouse
            //	True  - UserPaint
            //	True  - UseTextForAccessibility
            #endregion

            // We use double buffering to reduce drawing flicker
            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // We need to repaint entire control whenever resized
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Yes, we want to be drawn double buffered by default
            DoubleBuffered = true;

            // Setup the invokes
            _refreshCall = new SimpleCall(OnPerformRefresh);
            _layoutCall = new SimpleCall(OnPerformLayout);

            // Setup the need paint delegate
            _needPaintDelegate = new NeedPaintHandler(OnNeedPaint);
            _needPaintPaletteDelegate = new NeedPaintHandler(OnPaletteNeedPaint);

            // Must layout before first draw attempt
            _layoutDirty = true;
            _evalTransparent = true;
            _dirtyPaletteCounter = 1;

            // Set the palette and renderer to the defaults as specified by the manager
            _localPalette = null;
            SetPalette(KryptonManager.CurrentGlobalPalette);
            _paletteMode = PaletteMode.Global;

            // Create constant target for resolving palette delegates
            _redirector = CreateRedirector();

            // Hook into global palette changing events
            KryptonManager.GlobalPaletteChanged += new EventHandler(OnGlobalPaletteChanged);

            // We need to notice when system color settings change
            SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
        }