Storage for palette header states.
Наследование: Storage
Пример #1
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteHeaders class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteHeaders(PaletteRedirect redirector,
                                       NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);
            // Create the button style specific and common palettes
            HeaderCommon       = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, needPaint);
            HeaderPrimary      = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, needPaint);
            HeaderSecondary    = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderSecondary, PaletteBorderStyle.HeaderSecondary, PaletteContentStyle.HeaderSecondary, needPaint);
            HeaderDockInactive = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderDockInactive, PaletteBorderStyle.HeaderDockInactive, PaletteContentStyle.HeaderDockInactive, needPaint);
            HeaderDockActive   = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderDockActive, PaletteBorderStyle.HeaderDockActive, PaletteContentStyle.HeaderDockActive, needPaint);
            HeaderCalendar     = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCalendar, PaletteBorderStyle.HeaderCalendar, PaletteContentStyle.HeaderCalendar, needPaint);
            HeaderForm         = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderForm, PaletteBorderStyle.HeaderForm, PaletteContentStyle.HeaderForm, needPaint);
            HeaderCustom1      = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCustom1, PaletteBorderStyle.HeaderCustom1, PaletteContentStyle.HeaderCustom1, needPaint);
            HeaderCustom2      = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCustom2, PaletteBorderStyle.HeaderCustom2, PaletteContentStyle.HeaderCustom2, needPaint);
            HeaderCustom3      = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCustom3, PaletteBorderStyle.HeaderCustom3, PaletteContentStyle.HeaderCustom3, needPaint);

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

            // Inform the button style to use the new redirector
            HeaderPrimary.SetRedirector(redirectCommon);
            HeaderSecondary.SetRedirector(redirectCommon);
            HeaderDockInactive.SetRedirector(redirectCommon);
            HeaderDockActive.SetRedirector(redirectCommon);
            HeaderCalendar.SetRedirector(redirectCommon);
            HeaderForm.SetRedirector(redirectCommon);
            HeaderCustom1.SetRedirector(redirectCommon);
            HeaderCustom2.SetRedirector(redirectCommon);
            HeaderCustom3.SetRedirector(redirectCommon);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteHeaders class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteHeaders(PaletteRedirect redirector,
                                       NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);
            // Create the button style specific and common palettes
            _headerCommon = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, needPaint);
            _headerPrimary = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderPrimary, PaletteBorderStyle.HeaderPrimary, PaletteContentStyle.HeaderPrimary, needPaint);
            _headerSecondary = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderSecondary, PaletteBorderStyle.HeaderSecondary, PaletteContentStyle.HeaderSecondary, needPaint);
            _headerDockInactive = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderDockInactive, PaletteBorderStyle.HeaderDockInactive, PaletteContentStyle.HeaderDockInactive, needPaint);
            _headerDockActive = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderDockActive, PaletteBorderStyle.HeaderDockActive, PaletteContentStyle.HeaderDockActive, needPaint);
            _headerCalendar = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCalendar, PaletteBorderStyle.HeaderCalendar, PaletteContentStyle.HeaderCalendar, needPaint);
            _headerForm = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderForm, PaletteBorderStyle.HeaderForm, PaletteContentStyle.HeaderForm, needPaint);
            _headerCustom1 = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCustom1, PaletteBorderStyle.HeaderCustom1, PaletteContentStyle.HeaderCustom1, needPaint);
            _headerCustom2 = new KryptonPaletteHeader(redirector, PaletteBackStyle.HeaderCustom2, PaletteBorderStyle.HeaderCustom2, PaletteContentStyle.HeaderCustom2, needPaint);

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

            // Inform the button style to use the new redirector
            _headerPrimary.SetRedirector(redirectCommon);
            _headerSecondary.SetRedirector(redirectCommon);
            _headerDockInactive.SetRedirector(redirectCommon);
            _headerDockActive.SetRedirector(redirectCommon);
            _headerCalendar.SetRedirector(redirectCommon);
            _headerForm.SetRedirector(redirectCommon);
            _headerCustom1.SetRedirector(redirectCommon);
            _headerCustom2.SetRedirector(redirectCommon);
        }