/// <summary> /// Initialize a new instance of the PaletteElementColorInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="element">Element value..</param> public PaletteElementColorInheritRedirect(PaletteRedirect redirect, PaletteElement element) { Debug.Assert(redirect != null); _redirect = redirect; Element = element; }
/// <summary> /// Initialize a new instance of the PaletteElementColorInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="element">Element value..</param> public PaletteElementColorInheritRedirect(PaletteRedirect redirect, PaletteElement element) { Debug.Assert(redirect != null); _redirect = redirect; _element = element; }
/// <summary> /// Initialize a new instance of the PaletteElementColorRedirect class. /// </summary> /// <param name="redirect">Source for inheriting values.</param> /// <param name="element">Element value.</param> /// <param name="needPaint">Delegate for notifying changes in value.</param> public PaletteElementColorRedirect(PaletteRedirect redirect, PaletteElement element, NeedPaintHandler needPaint) : base(null, needPaint) { // Setup inheritence to recover values from the redirect instance _redirect = new PaletteElementColorInheritRedirect(redirect, element); SetInherit(_redirect); }
/// <summary> /// Gets the fifth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor5(PaletteElement element, PaletteState state) { switch (element) { case PaletteElement.TrackBarTick: if (CommonHelper.IsOverrideState(state)) return Color.Empty; return _trackBarColors[0]; case PaletteElement.TrackBarTrack: if (CommonHelper.IsOverrideState(state)) return Color.Empty; return _trackBarColors[3]; case PaletteElement.TrackBarPosition: if (CommonHelper.IsOverrideStateExclude(state, PaletteState.FocusOverride)) return Color.Empty; switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(_ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack1]); case PaletteState.Normal: return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; case PaletteState.Tracking: case PaletteState.FocusOverride: return _buttonBackColors[3]; case PaletteState.Pressed: return _buttonBackColors[5]; default: throw new ArgumentOutOfRangeException("state"); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }
/// <summary> /// Gets the first element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor1(PaletteElement element, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) return Color.Empty; switch (element) { case PaletteElement.TrackBarTick: return _trackBarColors[0]; case PaletteElement.TrackBarTrack: return _trackBarColors[1]; case PaletteElement.TrackBarPosition: switch (state) { case PaletteState.Disabled: return Color.Empty; default: return _trackBarColors[4]; } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }
/// <summary> /// Gets the third element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor3(PaletteElement element, PaletteState state) { if (CommonHelper.IsOverrideState(state)) return Color.Empty; switch (element) { case PaletteElement.TrackBarTick: return _trackBarColors[0]; case PaletteElement.TrackBarTrack: return _trackBarColors[3]; case PaletteElement.TrackBarPosition: switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(_sparkleColors[5]); case PaletteState.Normal: case PaletteState.FocusOverride: return ControlPaint.Light(_sparkleColors[5]); case PaletteState.Tracking: return ControlPaint.Light(_sparkleColors[6]); case PaletteState.Pressed: return ControlPaint.Light(_sparkleColors[8]); default: throw new ArgumentOutOfRangeException("state"); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }
/// <summary> /// Gets the fifth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public virtual Color GetElementColor5(PaletteElement element, PaletteState state) { return _target.GetElementColor5(element, state); }
/// <summary> /// Gets the fifth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public abstract Color GetElementColor5(PaletteElement element, PaletteState state);
/// <summary> /// Gets the fifth element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor5(PaletteElement element, PaletteState state) { switch (element) { case PaletteElement.TrackBarTick: if (CommonHelper.IsOverrideState(state)) return Color.Empty; return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: if (CommonHelper.IsOverrideState(state)) return Color.Empty; return SystemColors.Control; case PaletteElement.TrackBarPosition: if (CommonHelper.IsOverrideStateExclude(state, PaletteState.FocusOverride)) return Color.Empty; switch (state) { case PaletteState.Disabled: return ControlPaint.LightLight(ColorTable.MenuStripGradientBegin); case PaletteState.Normal: return ColorTable.MenuStripGradientBegin; case PaletteState.Tracking: case PaletteState.FocusOverride: return ColorTable.ButtonSelectedGradientEnd; case PaletteState.Pressed: return ColorTable.ButtonPressedGradientEnd; default: throw new ArgumentOutOfRangeException("state"); } default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }
/// <summary> /// Gets the first element color. /// </summary> /// <param name="element">Element for which color is required.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetElementColor1(PaletteElement element, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) return Color.Empty; switch (element) { case PaletteElement.TrackBarTick: return ColorTable.SeparatorDark; case PaletteElement.TrackBarTrack: return ColorTable.OverflowButtonGradientEnd; case PaletteElement.TrackBarPosition: return Color.FromArgb(128, Color.White); default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }