Implement storage for palette background details.
상속: Storage, IPaletteBack
예제 #1
0
 /// <summary>
 /// Initialize a new instance of the PaletteTreeState class.
 /// </summary>
 /// <param name="inherit">Source for inheriting values.</param>
 /// <param name="back">Reference to back storage.</param>
 /// <param name="border">Reference to border storage.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteTreeState(PaletteTreeStateRedirect inherit,
                         PaletteBack back,
                         PaletteBorder border,
                         NeedPaintHandler needPaint)
     : base(inherit, back, border, needPaint)
 {
     _nodeTriple = new PaletteTriple(inherit.Node, needPaint);
 }
 /// <summary>
 /// Initialize a new instance of the KryptonPalettePanel class.
 /// </summary>
 /// <param name="redirect">Redirector to inherit values from.</param>
 /// <param name="backStyle">Back style.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public KryptonPalettePanel(PaletteRedirect redirect,
                            PaletteBackStyle backStyle,
                            NeedPaintHandler needPaint)
 {
     // Create the storage objects
     _stateInherit = new PaletteBackInheritRedirect(redirect, backStyle);
     _stateCommon = new PaletteBack(_stateInherit, needPaint);
     _stateDisabled = new PaletteBack(_stateCommon, needPaint);
     _stateNormal = new PaletteBack(_stateCommon, needPaint);
 }
예제 #3
0
 /// <summary>
 /// Initialize a new instance of the PaletteDouble class.
 /// </summary>
 /// <param name="inherit">Source for inheriting values.</param>
 /// <param name="back">Reference to back storage.</param>
 /// <param name="border">Reference to border storage.</param>
 /// <param name="needPaint">Delegate for notifying paint requests.</param>
 public PaletteDouble(IPaletteDouble inherit,
                      PaletteBack back,
                      PaletteBorder border,
                      NeedPaintHandler needPaint)
 {
     // Store the provided references
     NeedPaint = needPaint;
     _back = back;
     _border = border;
 }
예제 #4
0
        /// <summary>
        /// Initialize a new instance of the PaletteDouble class.
        /// </summary>
        /// <param name="inherit">Source for inheriting values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDouble(IPaletteDouble inherit,
                             NeedPaintHandler needPaint)
        {
            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create storage that maps onto the inherit instances
            _back = new PaletteBack(inherit.PaletteBack, needPaint);
            _border = new PaletteBorder(inherit.PaletteBorder, needPaint);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteDataGridViewTripleStates class.
        /// </summary>
        /// <param name="inherit">Source for inheriting values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDataGridViewTripleStates(IPaletteTriple inherit,
                                               NeedPaintHandler needPaint)
        {
            Debug.Assert(inherit != null);

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create storage that maps onto the inherit instances
            _back = new PaletteBack(inherit.PaletteBack, needPaint);
            _border = new PaletteBorder(inherit.PaletteBorder, needPaint);
            _content = new PaletteDataGridViewContentStates(inherit.PaletteContent, needPaint);
        }
예제 #6
0
        /// <summary>
        /// Initialize a new instance of the PaletteTripleRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="backStyle">Initial background style.</param>
        /// <param name="borderStyle">Initial border style.</param>
        /// <param name="contentStyle">Initial content style.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTripleRedirect(PaletteRedirect redirect,
                                     PaletteBackStyle backStyle,
                                     PaletteBorderStyle borderStyle,
                                     PaletteContentStyle contentStyle,
                                     NeedPaintHandler needPaint)
        {
            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Store the inherit instances
            _backInherit    = new PaletteBackInheritRedirect(redirect, backStyle);
            _borderInherit  = new PaletteBorderInheritRedirect(redirect, borderStyle);
            _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle);

            // Create storage that maps onto the inherit instances
            _back    = new PaletteBack(_backInherit, needPaint);
            _border  = new PaletteBorder(_borderInherit, needPaint);
            _content = new PaletteContent(_contentInherit, needPaint);
        }
예제 #7
0
        /// <summary>
        /// Initialize a new instance of the PaletteTreeStateRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="back">Storage for back values.</param>
        /// <param name="backInherit">Inheritence for back values.</param>
        /// <param name="border">Storage for border values.</param>
        /// <param name="borderInherit">Inheritence for border values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTreeStateRedirect(PaletteRedirect redirect,
                                        PaletteBack back,
                                        PaletteBackInheritRedirect backInherit,
                                        PaletteBorder border,
                                        PaletteBorderInheritRedirect borderInherit,
                                        NeedPaintHandler needPaint)
            : base(redirect, back, backInherit, border, borderInherit, needPaint)
        {
            Debug.Assert(redirect != null);

            // Remember the redirect reference
            _redirect = redirect;

            // Create the item redirector
            _nodeRedirect = new PaletteTripleRedirect(redirect,
                                                      PaletteBackStyle.ButtonListItem,
                                                      PaletteBorderStyle.ButtonListItem,
                                                      PaletteContentStyle.ButtonListItem,
                                                      needPaint);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteTreeStateRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="back">Storage for back values.</param>
        /// <param name="backInherit">Inheritence for back values.</param>
        /// <param name="border">Storage for border values.</param>
        /// <param name="borderInherit">Inheritence for border values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTreeStateRedirect(PaletteRedirect redirect,
                                        PaletteBack back,
                                        PaletteBackInheritRedirect backInherit,
                                        PaletteBorder border,
                                        PaletteBorderInheritRedirect borderInherit,
                                        NeedPaintHandler needPaint)
            : base(redirect, back, backInherit, border, borderInherit, needPaint)
        {
            Debug.Assert(redirect != null);

            // Remember the redirect reference
            _redirect = redirect;

            // Create the item redirector
            _nodeRedirect = new PaletteTripleRedirect(redirect,
                                                      PaletteBackStyle.ButtonListItem,
                                                      PaletteBorderStyle.ButtonListItem,
                                                      PaletteContentStyle.ButtonListItem,
                                                      needPaint);
        }
예제 #9
0
        /// <summary>
        /// Initialize a new instance of the PaletteDataGridViewTripleRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="backStyle">Initial background style.</param>
        /// <param name="borderStyle">Initial border style.</param>
        /// <param name="contentStyle">Initial content style.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDataGridViewTripleRedirect(PaletteRedirect redirect,
                                                 PaletteBackStyle backStyle,
                                                 PaletteBorderStyle borderStyle,
                                                 PaletteContentStyle contentStyle,
                                                 NeedPaintHandler needPaint)
        {
            Debug.Assert(redirect != null);

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Store the inherit instances
            _backInherit    = new PaletteBackInheritRedirect(redirect, backStyle);
            _borderInherit  = new PaletteBorderInheritRedirect(redirect, borderStyle);
            _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle);

            // Create storage that maps onto the inherit instances
            Back    = new PaletteBack(_backInherit, needPaint);
            Border  = new PaletteBorder(_borderInherit, needPaint);
            Content = new PaletteDataGridViewContentCommon(_contentInherit, needPaint);
        }
예제 #10
0
        /// <summary>
        /// Initialize a new instance of the PaletteTabTripleRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection instance.</param>
        /// <param name="backStyle">Initial background style.</param>
        /// <param name="borderStyle">Initial border style.</param>
        /// <param name="contentStyle">Initial content style.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteTabTripleRedirect(PaletteRedirect redirect,
            PaletteBackStyle backStyle,
            PaletteBorderStyle borderStyle,
            PaletteContentStyle contentStyle,
            NeedPaintHandler needPaint)
        {
            Debug.Assert(redirect != null);

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Store the inherit instances
            _backInherit = new PaletteBackInheritRedirect(redirect, backStyle);
            _borderInherit = new PaletteBorderInheritRedirect(redirect, borderStyle);
            _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle);

            // Create storage that maps onto the inherit instances
            _back = new PaletteBack(_backInherit, needPaint);
            _border = new PaletteTabBorder(_borderInherit, needPaint);
            _content = new PaletteContent(_contentInherit, needPaint);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteTrackBarStatesOverride class.
        /// </summary>
        /// <param name="normalStates">Normal state values.</param>
        /// <param name="overrideStates">Override state values.</param>
        /// <param name="overrideState">State to override.</param>
        public PaletteTrackBarStatesOverride(PaletteTrackBarRedirect normalStates,
                                             PaletteTrackBarStates overrideStates,
                                             PaletteState overrideState)
        {
            Debug.Assert(normalStates != null);
            Debug.Assert(overrideStates != null);

            // Validate incoming references
            if (normalStates == null) throw new ArgumentNullException("normalStates");
            if (overrideStates == null) throw new ArgumentNullException("overrideStates");

            // Create the triple override instances
            _back = normalStates.Back;
            _overrideTickState = new PaletteElementColorInheritOverride(normalStates.Tick, overrideStates.Tick);
            _overrideTrackState = new PaletteElementColorInheritOverride(normalStates.Track, overrideStates.Track);
            _overridePositionState = new PaletteElementColorInheritOverride(normalStates.Position, overrideStates.Position);

            // Do not apply an override by default
            Apply = false;

            // Always override the state
            Override = true;
            OverrideState = overrideState;
        }