Exemple #1
0
        /// <summary>
        ///  Initialize a new instance of the KryptonContextMenu class.
        /// </summary>
        public KryptonContextMenu()
        {
            // Setup the need paint delegate
            _needPaintDelegate = OnNeedPaint;

            // Set default settings
            Palette           = null;
            PaletteMode       = PaletteMode.Global;
            Images            = new ContextMenuImages(_needPaintDelegate);
            _redirector       = new PaletteRedirect(null);
            _redirectorImages = new PaletteRedirectContextMenu(_redirector, Images);
            Enabled           = true;

            // Create the palette storage
            StateCommon    = new PaletteContextMenuRedirect(_redirector, _needPaintDelegate);
            StateNormal    = new PaletteContextMenuItemState(StateCommon);
            StateDisabled  = new PaletteContextMenuItemState(StateCommon);
            StateHighlight = new PaletteContextMenuItemStateHighlight(StateCommon);
            StateChecked   = new PaletteContextMenuItemStateChecked(StateCommon);

            // Create the top level collection for menu items
            Items = new KryptonContextMenuCollection();
        }