/// <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(); }