• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PaletteState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PaletteState的典型用法代码示例。如果您正苦于以下问题:C# PaletteState类的具体用法?C# PaletteState怎么用?C# PaletteState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PaletteState类属于命名空间,在下文中一共展示了PaletteState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetContentLongTextColor1

 /// <summary>
 /// Gets the first back color for the long text.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public override Color GetContentLongTextColor1(PaletteState state)
 {
     if (_overrideTextColor != Color.Empty)
         return _overrideTextColor;
     else
         return RibbonGeneral.GetRibbonContextTextColor(state);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:12,代码来源:ContextToContent.cs


示例2: GetBackColor1

        /// <summary>
        /// Gets the first background color.
        /// </summary>
        /// <param name="style">Background style.</param>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetBackColor1(PaletteBackStyle style, PaletteState state)
        {
            // Only override system palette if a recognized office 2003 color scheme is used
            if (_usingOffice2003)
            {
                switch (style)
                {
                    case PaletteBackStyle.ContextMenuItemHighlight:
                        switch (state)
                        {
                            case PaletteState.Disabled:
                                return SystemColors.Control;
                            case PaletteState.Normal:
                                return Color.Empty;
                            case PaletteState.Tracking:
                                return ColorTable.MenuItemSelectedGradientBegin;
                        }
                        break;
                    case PaletteBackStyle.HeaderDockInactive:
                        if (state == PaletteState.Disabled)
                            return SystemColors.Control;
                        else
                            return ColorTable.ButtonCheckedHighlight;
                    case PaletteBackStyle.HeaderDockActive:
                        if (state == PaletteState.Disabled)
                            return SystemColors.Control;
                        else
                            return SystemColors.Highlight;
                }
            }

            return base.GetBackColor1(style, state);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:39,代码来源:PaletteProfessionalOffice2003.cs


示例3: GetContentLongTextColor2

 /// <summary>
 /// Gets the second back color for the long text.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public override Color GetContentLongTextColor2(PaletteState state)
 {
     if (state == PaletteState.Normal)
         return _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state);
     else
         return _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:12,代码来源:DesignTextToContent.cs


示例4: GetContentLongTextColor2

 /// <summary>
 /// Gets the second back color for the long text.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public override Color GetContentLongTextColor2(PaletteState state)
 {
     if (state == PaletteState.Disabled)
         return _ribbonGroupTextDisabled.GetRibbonTextColor(state);
     else
         return _ribbonGroupTextNormal.GetRibbonTextColor(state);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:12,代码来源:RibbonGroupNormalDisabledTextToContent.cs


示例5: DrawInputControlDropDownGlyph

        /// <summary>
        /// Draw a drop down grid appropriate for a input control.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="cellRect">Available drawing rectangle space.</param>
        /// <param name="paletteContent">Content palette for getting colors.</param>
        /// <param name="state">State associated with rendering.</param>
        public override void DrawInputControlDropDownGlyph(RenderContext context,
                                                           Rectangle cellRect,
                                                           IPaletteContent paletteContent,
                                                           PaletteState state)
        {
            Debug.Assert(context != null);
            Debug.Assert(paletteContent != null);

            // Validate parameter references
            if (context == null) throw new ArgumentNullException("context");
            if (paletteContent == null) throw new ArgumentNullException("paletteContent");

            Color c1 = paletteContent.GetContentShortTextColor1(state);

            // Find the top left starting position for drawing lines
            int xStart = cellRect.Left + (cellRect.Right - cellRect.Left - 4) / 2;
            int yStart = cellRect.Top + (cellRect.Bottom - cellRect.Top - 3) / 2;

            using (Pen darkPen = new Pen(c1))
            {
                context.Graphics.DrawLine(darkPen, xStart, yStart, xStart + 4, yStart);
                context.Graphics.DrawLine(darkPen, xStart + 1, yStart + 1, xStart + 3, yStart + 1);
                context.Graphics.DrawLine(darkPen, xStart + 2, yStart + 2, xStart + 2, yStart + 1);
            }
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:32,代码来源:RenderSparkle.cs


示例6: GetDropDownButtonImage

        /// <summary>
        /// Gets a drop down button image appropriate for the provided state.
        /// </summary>
        /// <param name="state">PaletteState for which image is required.</param>
        public override Image GetDropDownButtonImage(PaletteState state)
        {
            // Grab state specific image
            Image retImage = null;
            switch(state)
            {
                case PaletteState.Disabled:
                    retImage = _images.Disabled;
                    break;
                case PaletteState.Normal:
                    retImage = _images.Normal;
                    break;
                case PaletteState.Tracking:
                    retImage = _images.Tracking;
                    break;
                case PaletteState.Pressed:
                    retImage = _images.Pressed;
                    break;
            }

            // Not found, then get the common image
            if (retImage == null)
                retImage = _images.Common;

            // Not found, then inherit from target
            if (retImage == null)
                retImage = Target.GetDropDownButtonImage(state);

            return retImage;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:34,代码来源:PaletteRedirectDropDownButton.cs


示例7: PaletteRibbonTabContentInheritOverride

        /// <summary>
        /// Initialize a new instance of the PaletteRibbonTabContentInheritOverride class.
        /// </summary>
        /// <param name="primaryBack">First choice inheritence background.</param>
        /// <param name="primaryText">First choice inheritence text.</param>
        /// <param name="primaryContent">First choice inheritence content.</param>
        /// <param name="backupBack">Backup inheritence background.</param>
        /// <param name="backupText">Backup inheritence text.</param>
        /// <param name="backupContent">Backup inheritence content.</param>
        /// <param name="state">Palette state to override.</param>
        public PaletteRibbonTabContentInheritOverride(IPaletteRibbonBack primaryBack,
                                                      IPaletteRibbonText primaryText,
                                                      IPaletteContent primaryContent,
                                                      IPaletteRibbonBack backupBack,
                                                      IPaletteRibbonText backupText,
                                                      IPaletteContent backupContent,
                                                      PaletteState state)
        {
            Debug.Assert(primaryBack != null);
            Debug.Assert(primaryText != null);
            Debug.Assert(primaryContent != null);
            Debug.Assert(backupBack != null);
            Debug.Assert(backupText != null);
            Debug.Assert(backupContent != null);

            // Remember values
            _primaryBack = primaryBack;
            _primaryText = primaryText;
            _primaryContent = primaryContent;
            _backupBack = backupBack;
            _backupText = backupText;
            _backupContent = backupContent;

            // Default state
            _apply = false;
            _override = true;
            _state = state;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:38,代码来源:PaletteRibbonTabContentInheritOverride.cs


示例8: DrawSeparator

        /// <summary>
        /// Perform drawing of a separator glyph.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="displayRect">Display area available for drawing.</param>
        /// <param name="paletteBack">Background palette details.</param>
        /// <param name="paletteBorder">Border palette details.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        /// <param name="state">State associated with rendering.</param>
        /// <param name="canMove">Can the separator be moved.</param>
        public override void DrawSeparator(RenderContext context,
                                           Rectangle displayRect,
                                           IPaletteBack paletteBack,
                                           IPaletteBorder paletteBorder,
                                           Orientation orientation,
                                           PaletteState state,
                                           bool canMove)
        {
            // Let base class perform standard processing
            base.DrawSeparator(context,
                               displayRect,
                               paletteBack,
                               paletteBorder,
                               orientation,
                               state,
                               canMove);

            // If we are drawing the background then draw grab handles on top
            if (paletteBack.GetBackDraw(state) == InheritBool.True)
            {
                // Only draw grab handle if the user can move the separator
                if (canMove)
                    DrawGrabHandleGlyph(context, displayRect, orientation, state);
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:35,代码来源:RenderProfessional.cs


示例9: GetBackColor2

 /// <summary>
 /// Gets the second back color.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public override Color GetBackColor2(PaletteState state)
 {
     if ((TreeNode != null) && (TreeNode.BackColor != Color.Empty))
         return TreeNode.BackColor;
     else
         return _inherit.GetBackColor2(state);
 }
开发者ID:yp25,项目名称:Krypton,代码行数:12,代码来源:PaletteBackInheritNode.cs


示例10: KryptonBorderEdge

        /// <summary>
        /// Initialize a new instance of the KryptonBorderEdge class.
        /// </summary>
        public KryptonBorderEdge()
        {
            // The label cannot take the focus
            SetStyle(ControlStyles.Selectable, false);

            // Set default label style
            _orientation = Orientation.Horizontal;

            // Create the palette storage
            _borderRedirect = new PaletteBorderInheritRedirect(Redirector, PaletteBorderStyle.ControlClient);
            _stateCommon = new PaletteBorderEdgeRedirect(_borderRedirect, NeedPaintDelegate);
            _stateDisabled = new PaletteBorderEdge(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteBorderEdge(_stateCommon, NeedPaintDelegate);
            _stateCurrent = _stateNormal;
            _state = PaletteState.Normal;

            // Our view contains just a simple canvas that covers entire client area
            _drawPanel = new ViewDrawPanel(_stateNormal);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawPanel);

            // We want to be auto sized by default, but not the property default!
            AutoSize = true;
            AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:29,代码来源:KryptonBorderEdge.cs


示例11: GetBackColor2

 /// <summary>
 /// Gets the second back color.
 /// </summary>
 /// <param name="style">Background style.</param>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public override Color GetBackColor2(PaletteBackStyle style, PaletteState state)
 {
     IPaletteTriple inherit = GetInherit(state);
     if (inherit != null)
         return inherit.PaletteBack.GetBackColor2(state);
     else
         return base.GetBackColor2(style, state);
 }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:14,代码来源:PaletteRedirectCommon.cs


示例12: GetMetricBool

        /// <summary>
        /// Gets a boolean metric value.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <param name="metric">Requested metric.</param>
        /// <returns>InheritBool value.</returns>
        public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric)
        {
            IPaletteMetric inherit = GetInherit(state);

            if (inherit != null)
                return inherit.GetMetricBool(state, metric);
            else
                return Target.GetMetricBool(state, metric);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:15,代码来源:PaletteRedirectTripleMetric.cs


示例13: GetBorderColor1

        /// <summary>
        /// Gets the first border color.
        /// </summary>
        /// <param name="style">Border style.</param>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetBorderColor1(PaletteBorderStyle style, PaletteState state)
        {
            PaletteBorderEdge inherit = GetInherit(state);

            if (inherit != null)
                return inherit.GetBackColor1(state);
            else
                return Target.GetBorderColor1(style, state);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:15,代码来源:PaletteRedirectBorderEdge.cs


示例14: GetBackColor2

        /// <summary>
        /// Gets the second back color.
        /// </summary>
        /// <param name="style">Background style.</param>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetBackColor2(PaletteBackStyle style, PaletteState state)
        {
            IPaletteBack inherit = GetInheritBack(style, state);

            if (inherit != null)
                return inherit.GetBackColor2(state);
            else
                return Target.GetBackColor2(style, state);
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:15,代码来源:PaletteRedirectGrids.cs


示例15: GetBorderDrawBorders

        /// <summary>
        /// Gets a value indicating which borders to draw.
        /// </summary>
        /// <param name="style">Border style.</param>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>PaletteDrawBorders value.</returns>
        public override PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state)
        {
            PaletteDrawBorders paletteBorder = base.GetBorderDrawBorders(style, state);

            // The ribbon caption area should only ever draw a bottom border as the maximum
            if ((paletteBorder & PaletteDrawBorders.Bottom) == PaletteDrawBorders.Bottom)
                return PaletteDrawBorders.Bottom;
            else
                return PaletteDrawBorders.None;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:16,代码来源:PaletteCaptionRedirect.cs


示例16: GetRibbonBackColor2

        /// <summary>
        /// Gets the second background color for the ribbon item.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public Color GetRibbonBackColor2(PaletteState state)
        {
            Color retColor = _inherit.GetRibbonBackColor2(state);

            // If empty then try and recover the context specific color
            if (retColor == Color.Empty)
                retColor = CheckForContextColor(state);

            return retColor;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:15,代码来源:PaletteRibbonContextBack.cs


示例17: GetBackColor1

        /// <summary>
        /// Gets the first background color.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetBackColor1(PaletteState state)
        {
            switch (state)
            {
                case PaletteState.Normal:
                    return _cellStyle.BackColor;
                case PaletteState.CheckedNormal:
                    return _cellStyle.SelectionBackColor;
            }

            return _inherit.GetBackColor1(state);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:17,代码来源:PaletteDataGridViewBackInherit.cs


示例18: GetContentLongTextColor2

        /// <summary>
        /// Gets the second back color for the long text.
        /// </summary>
        /// <param name="style">Content style.</param>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetContentLongTextColor2(PaletteContentStyle style, PaletteState state)
        {
            // We only want to override buttons specs that are drawing in normal mode
            if ((style == PaletteContentStyle.ButtonButtonSpec) && (state == PaletteState.Normal))
            {
                // If the ribbon is showing in office 2010 style and using glass
                if (_ribbon.CaptionArea.DrawCaptionOnComposition && (_ribbon.RibbonShape == PaletteRibbonShape.Office2010))
                    return LightBackground(base.GetContentLongTextColor2(style, state));
            }

            return base.GetContentLongTextColor2(style, state);
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:18,代码来源:PaletteRedirectRibbonAeroOverride.cs


示例19: PaletteNavigatorOverride

        /// <summary>
        /// Initialize a new instance of the PaletteNavigatorOverride class.
        /// </summary>
        /// <param name="checkButtonNormal">Normal palette to use.</param>
        /// <param name="checkButtonOther">Override palette to use.</param>
        /// <param name="overrideState">State used by the override.</param>
        public PaletteNavigatorOverride(IPaletteTriple checkButtonNormal,
                                        IPaletteTriple checkButtonOther,
                                        PaletteState overrideState)
        {
            Debug.Assert(checkButtonNormal != null);
            Debug.Assert(checkButtonOther != null);

            // Create the palette storage
            _overrideCheckButton = new PaletteTripleOverride(checkButtonNormal,
                                                             checkButtonOther,
                                                             overrideState);

            // Do not apply an override by default
            Apply = false;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:21,代码来源:PaletteNavigatorOtherOverride.cs


示例20: PaletteElementColorInheritOverride

        /// <summary>
        /// Initialize a new instance of the PaletteElementColorInheritOverride class.
        /// </summary>
        /// <param name="primary">First choice inheritence.</param>
        /// <param name="backup">Backup inheritence.</param>
        public PaletteElementColorInheritOverride(IPaletteElementColor primary,
                                                  IPaletteElementColor backup)
        {
            Debug.Assert(primary != null);
            Debug.Assert(backup != null);

            // Store incoming alternatives
            _primary = primary;
            _backup = backup;

            // Default other state
            _apply = true;
            _override = true;
            _state = PaletteState.Normal;
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:20,代码来源:PaletteElementColorInheritOverride.cs



注:本文中的PaletteState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Pane类代码示例发布时间:2022-05-24
下一篇:
C# PaletteContentStyle类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap