Manage a collection of button specs for placing within a collection of ViewLayoutDocker instances.
Inheritance: ButtonSpecManagerBase
Ejemplo n.º 1
0
        private void CreateButtonManager(RibbonAppButton appButton)
        {
            _buttonManager = new ButtonSpecManagerLayoutAppButton((ViewContextMenuManager)ViewManager,
                                                                  this, _redirector, appButton.AppButtonSpecs, null,
                                                                  new ViewLayoutDocker[] { _viewButtonSpecDocker },
                                                                  new IPaletteMetric[] { _ribbon.StateCommon },
                                                                  new PaletteMetricInt[] { PaletteMetricInt.None },
                                                                  new PaletteMetricPadding[] { PaletteMetricPadding.RibbonAppButton },
                                                                  new GetToolStripRenderer(CreateToolStripRenderer),
                                                                  new NeedPaintHandler(OnButtonSpecPaint));

            _buttonManager.RecreateButtons();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Must unhook from the palette paint event
                if (_palette != null)
                {
                    _palette.PalettePaint -= new EventHandler<PaletteLayoutEventArgs>(OnPaletteNeedPaint);
                    _palette.BasePaletteChanged -= new EventHandler(OnBaseChanged);
                    _palette.BaseRendererChanged -= new EventHandler(OnBaseChanged);
                }

                if (_buttonManager != null)
                {
                    _buttonManager.Destruct();
                    _buttonManager = null;
                }
            }

            base.Dispose(disposing);
        }