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

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

            // Create the button style specific and common palettes
            LabelCommon        = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            LabelNormalControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            LabelBoldControl   = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelBoldControl, needPaint);
            LabelItalicControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelItalicControl, needPaint);
            LabelTitleControl  = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitleControl, needPaint);
            LabelNormalPanel   = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalPanel, needPaint);
            LabelBoldPanel     = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelBoldPanel, needPaint);
            LabelItalicPanel   = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelItalicPanel, needPaint);
            LabelTitlePanel    = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitlePanel, needPaint);
            LabelCaptionPanel  = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelGroupBoxCaption, needPaint);
            LabelToolTip       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelToolTip, needPaint);
            LabelSuperTip      = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelSuperTip, needPaint);
            LabelKeyTip        = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelKeyTip, needPaint);
            LabelCustom1       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom1, needPaint);
            LabelCustom2       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom2, needPaint);
            LabelCustom3       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom3, needPaint);

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

            // Inform the button style to use the new redirector
            LabelNormalControl.SetRedirector(redirectCommon);
            LabelBoldControl.SetRedirector(redirectCommon);
            LabelItalicControl.SetRedirector(redirectCommon);
            LabelTitleControl.SetRedirector(redirectCommon);
            LabelNormalPanel.SetRedirector(redirectCommon);
            LabelBoldPanel.SetRedirector(redirectCommon);
            LabelItalicPanel.SetRedirector(redirectCommon);
            LabelTitlePanel.SetRedirector(redirectCommon);
            LabelCaptionPanel.SetRedirector(redirectCommon);
            LabelToolTip.SetRedirector(redirectCommon);
            LabelSuperTip.SetRedirector(redirectCommon);
            LabelKeyTip.SetRedirector(redirectCommon);
            LabelCustom1.SetRedirector(redirectCommon);
            LabelCustom2.SetRedirector(redirectCommon);
            LabelCustom3.SetRedirector(redirectCommon);
        }
Пример #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteLabels class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteLabels(PaletteRedirect redirector,
                                      NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _labelCommon = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            _labelNormalControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            _labelBoldControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelBoldControl, needPaint);
            _labelItalicControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelItalicControl, needPaint);
            _labelTitleControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitleControl, needPaint);
            _labelNormalPanel = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalPanel, needPaint);
            _labelBoldPanel = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelBoldPanel, needPaint);
            _labelItalicPanel = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelItalicPanel, needPaint);
            _labelTitlePanel = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitlePanel, needPaint);
            _labelCaptionPanel = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelGroupBoxCaption, needPaint);
            _labelToolTip = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelToolTip, needPaint);
            _labelSuperTip = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelSuperTip, needPaint);
            _labelKeyTip = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelKeyTip, needPaint);
            _labelCustom1 = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom1, needPaint);
            _labelCustom2 = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom2, needPaint);
            _labelCustom3 = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom3, needPaint);

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

            // Inform the button style to use the new redirector
            _labelNormalControl.SetRedirector(redirectCommon);
            _labelBoldControl.SetRedirector(redirectCommon);
            _labelItalicControl.SetRedirector(redirectCommon);
            _labelTitleControl.SetRedirector(redirectCommon);
            _labelNormalPanel.SetRedirector(redirectCommon);
            _labelBoldPanel.SetRedirector(redirectCommon);
            _labelItalicPanel.SetRedirector(redirectCommon);
            _labelTitlePanel.SetRedirector(redirectCommon);
            _labelCaptionPanel.SetRedirector(redirectCommon);
            _labelToolTip.SetRedirector(redirectCommon);
            _labelSuperTip.SetRedirector(redirectCommon);
            _labelKeyTip.SetRedirector(redirectCommon);
            _labelCustom1.SetRedirector(redirectCommon);
            _labelCustom2.SetRedirector(redirectCommon);
            _labelCustom3.SetRedirector(redirectCommon);
        }