Storage for palette separator states.
Inheritance: Storage
Esempio n. 1
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteSeparators class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteSeparators(PaletteRedirect redirector,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            SeparatorCommon              = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            SeparatorLowProfile          = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            SeparatorHighProfile         = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighProfile, PaletteBorderStyle.SeparatorHighProfile, needPaint);
            SeparatorHighInternalProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighInternalProfile, PaletteBorderStyle.SeparatorHighInternalProfile, needPaint);
            SeparatorCustom1             = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom1, PaletteBorderStyle.SeparatorCustom1, needPaint);
            SeparatorCustom2             = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom2, PaletteBorderStyle.SeparatorCustom2, needPaint);
            SeparatorCustom3             = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom3, PaletteBorderStyle.SeparatorCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector,
                                                                             SeparatorCommon.StateDisabled, SeparatorCommon.StateNormal,
                                                                             SeparatorCommon.StatePressed, SeparatorCommon.StateTracking);

            // Inform the button style to use the new redirector
            SeparatorLowProfile.SetRedirector(redirectCommon);
            SeparatorHighProfile.SetRedirector(redirectCommon);
            SeparatorHighInternalProfile.SetRedirector(redirectCommon);
            SeparatorCustom1.SetRedirector(redirectCommon);
            SeparatorCustom2.SetRedirector(redirectCommon);
            SeparatorCustom3.SetRedirector(redirectCommon);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteSeparators class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteSeparators(PaletteRedirect redirector,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _separatorCommon = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorLowProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorHighProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighProfile, PaletteBorderStyle.SeparatorHighProfile, needPaint);
            _separatorHighInternalProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighInternalProfile, PaletteBorderStyle.SeparatorHighInternalProfile, needPaint);
            _separatorCustom1 = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom1, PaletteBorderStyle.SeparatorCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector,
                                                                             _separatorCommon.StateDisabled, _separatorCommon.StateNormal,
                                                                             _separatorCommon.StatePressed, _separatorCommon.StateTracking);

            // Inform the button style to use the new redirector
            _separatorLowProfile.SetRedirector(redirectCommon);
            _separatorHighProfile.SetRedirector(redirectCommon);
            _separatorHighInternalProfile.SetRedirector(redirectCommon);
            _separatorCustom1.SetRedirector(redirectCommon);
        }