SetStyles() public méthode

Update the palette styles using a button style.
public SetStyles ( ButtonStyle buttonStyle ) : void
buttonStyle ButtonStyle New button style.
Résultat void
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMenuItemSelect class.
        /// </summary>
        /// <param name="itemSelect">Reference to owning instance.</param>
        /// <param name="provider">Provider of context menu information.</param>
        public ViewLayoutMenuItemSelect(KryptonContextMenuImageSelect itemSelect,
                                        IContextMenuProvider provider)
        {
            Debug.Assert(itemSelect != null);
            Debug.Assert(provider != null);

            // Store incoming references
            _itemSelect = itemSelect;
            _provider   = provider;

            _itemSelect.TrackingIndex = -1;
            _enabled     = provider.ProviderEnabled;
            _viewManager = provider.ProviderViewManager;

            // Cache the values to use when running
            _imageList       = _itemSelect.ImageList;
            _imageIndexStart = _itemSelect.ImageIndexStart;
            _imageIndexEnd   = _itemSelect.ImageIndexEnd;
            _lineItems       = _itemSelect.LineItems;
            _needPaint       = provider.ProviderNeedPaintDelegate;
            _padding         = _itemSelect.Padding;
            _imageCount      = (_imageList == null ? 0 : _imageList.Images.Count);

            // Limit check the start and end values
            _imageIndexStart = Math.Max(0, _imageIndexStart);
            _imageIndexEnd   = Math.Min(_imageIndexEnd, _imageCount - 1);
            _imageIndexCount = Math.Max(0, (_imageIndexEnd - _imageIndexStart) + 1);

            IPalette palette = provider.ProviderPalette;

            if (palette == null)
            {
                palette = KryptonManager.GetPaletteForMode(provider.ProviderPaletteMode);
            }

            // Create triple that can be used by the draw button
            _triple = new PaletteTripleToPalette(palette,
                                                 PaletteBackStyle.ButtonLowProfile,
                                                 PaletteBorderStyle.ButtonLowProfile,
                                                 PaletteContentStyle.ButtonLowProfile);

            // Update with current button style
            _triple.SetStyles(itemSelect.ButtonStyle);
        }
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMenuItemSelect class.
        /// </summary>
        /// <param name="itemSelect">Reference to owning instance.</param>
        /// <param name="provider">Provider of context menu information.</param>
        public ViewLayoutMenuItemSelect(KryptonContextMenuImageSelect itemSelect,
            IContextMenuProvider provider)
        {
            Debug.Assert(itemSelect != null);
            Debug.Assert(provider != null);

            // Store incoming references
            _itemSelect = itemSelect;
            _provider = provider;

            _itemSelect.TrackingIndex = -1;
            _enabled = provider.ProviderEnabled;
            _viewManager = provider.ProviderViewManager;

            // Cache the values to use when running
            _imageList = _itemSelect.ImageList;
            _imageIndexStart = _itemSelect.ImageIndexStart;
            _imageIndexEnd = _itemSelect.ImageIndexEnd;
            _lineItems = _itemSelect.LineItems;
            _needPaint = provider.ProviderNeedPaintDelegate;
            _padding = _itemSelect.Padding;
            _imageCount = (_imageList == null ? 0 : _imageList.Images.Count);

            // Limit check the start and end values
            _imageIndexStart = Math.Max(0, _imageIndexStart);
            _imageIndexEnd = Math.Min(_imageIndexEnd, _imageCount - 1);
            _imageIndexCount = Math.Max(0, (_imageIndexEnd - _imageIndexStart) + 1);

            IPalette palette = provider.ProviderPalette;
            if (palette == null)
                palette = KryptonManager.GetPaletteForMode(provider.ProviderPaletteMode);

            // Create triple that can be used by the draw button
            _triple = new PaletteTripleToPalette(palette,
                                                 PaletteBackStyle.ButtonLowProfile,
                                                 PaletteBorderStyle.ButtonLowProfile,
                                                 PaletteContentStyle.ButtonLowProfile);

            // Update with current button style
            _triple.SetStyles(itemSelect.ButtonStyle);
        }