/// <summary> /// Initialize a new instance of the PaletteRedirectContextMenu class. /// </summary> /// <param name="target">Initial palette target for redirection.</param> /// <param name="images">Reference to source of context menu images.</param> public PaletteRedirectContextMenu(IPalette target, ContextMenuImages images) : base(target) { Debug.Assert(images != null); // Remember incoming target _images = images; }
/// <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(); }
/// <summary> /// Initialize a new instance of the KryptonContextMenu class. /// </summary> public KryptonContextMenu() { // Setup the need paint delegate _needPaintDelegate = new NeedPaintHandler(OnNeedPaint); // Set default settings _localPalette = 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(); }