SetRedirector() публичный Метод

Update the redirector with new reference.
public SetRedirector ( PaletteRedirect redirect ) : void
redirect PaletteRedirect Target redirector.
Результат void
        /// <summary>
        /// Initialize a new instance of the KryptonPalettePanels class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPalettePanels(PaletteRedirect redirector,
                                      NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            PanelCommon         = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelClient, needPaint);
            PanelClient         = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelClient, needPaint);
            PanelAlternate      = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelAlternate, needPaint);
            PanelRibbonInactive = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelRibbonInactive, needPaint);
            PanelCustom1        = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelCustom1, needPaint);
            PanelCustom2        = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelCustom2, needPaint);
            PanelCustom3        = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectBack redirectCommon = new PaletteRedirectBack(redirector, PanelCommon.StateDisabled, PanelCommon.StateNormal);

            // Inform the button style to use the new redirector
            PanelClient.SetRedirector(redirectCommon);
            PanelAlternate.SetRedirector(redirectCommon);
            PanelRibbonInactive.SetRedirector(redirectCommon);
            PanelCustom1.SetRedirector(redirectCommon);
            PanelCustom2.SetRedirector(redirectCommon);
            PanelCustom3.SetRedirector(redirectCommon);
        }
Пример #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonPalettePanels class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPalettePanels(PaletteRedirect redirector,
                                      NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _panelCommon = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelClient, needPaint);
            _panelClient = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelClient, needPaint);
            _panelAlternate = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelAlternate, needPaint);
            _panelRibbonInactive = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelRibbonInactive, needPaint);
            _panelCustom1 = new KryptonPalettePanel(redirector, PaletteBackStyle.PanelCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectBack redirectCommon = new PaletteRedirectBack(redirector, _panelCommon.StateDisabled, _panelCommon.StateNormal);

            // Inform the button style to use the new redirector
            _panelClient.SetRedirector(redirectCommon);
            _panelAlternate.SetRedirector(redirectCommon);
            _panelRibbonInactive.SetRedirector(redirectCommon);
            _panelCustom1.SetRedirector(redirectCommon);
        }