当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriterStyle.ToString方法代码示例

本文整理汇总了C#中HtmlTextWriterStyle.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriterStyle.ToString方法的具体用法?C# HtmlTextWriterStyle.ToString怎么用?C# HtmlTextWriterStyle.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlTextWriterStyle的用法示例。


在下文中一共展示了HtmlTextWriterStyle.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetStyleName

        private String GetStyleName(HtmlTextWriterStyle key)
        {
            String name = key.ToString();
            if (name.Contains(".")) name = name.Substring(name.LastIndexOf(".") + 1);

            StringBuilder output = new StringBuilder();
            char[] cs = name.ToCharArray();
            for (int i = 0; i < cs.Length; i++)
            {
                if (Char.IsUpper(cs[i]) && i > 0)
                {
                    output.Append('-');
                    output.Append(cs[i]);
                }
                else
                {
                    output.Append(cs[i]);
                }
            }
            return output.ToString();
        }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:21,代码来源:HtmlTextWriter.cs

示例2: StyleConversion


//.........这里部分代码省略.........
                    break;
                case HtmlTextWriterStyle.FontSize:
                    this.CssStyleName = "font-size";
                    break;
                case HtmlTextWriterStyle.FontStyle:
                    this.CssStyleName = "font-style";
                    break;
                case HtmlTextWriterStyle.FontVariant:
                    this.CssStyleName = "font-variant";
                    break;
                case HtmlTextWriterStyle.FontWeight:
                    this.CssStyleName = "font-weight";
                    break;
                case HtmlTextWriterStyle.Height:
                    this.CssStyleName = "height";
                    break;
                case HtmlTextWriterStyle.Left:
                    this.CssStyleName = "left";
                    break;
                case HtmlTextWriterStyle.ListStyleImage:
                    this.CssStyleName = "list-style-image";
                    break;
                case HtmlTextWriterStyle.ListStyleType:
                    this.CssStyleName = "list-style-type";
                    break;
                case HtmlTextWriterStyle.Margin:
                    this.CssStyleName = "margin";
                    break;
                case HtmlTextWriterStyle.MarginBottom:
                    this.CssStyleName = "margin-bottom";
                    break;
                case HtmlTextWriterStyle.MarginLeft:
                    this.CssStyleName = "margin-left";
                    break;
                case HtmlTextWriterStyle.MarginRight:
                    this.CssStyleName = "margin-right";
                    break;
                case HtmlTextWriterStyle.MarginTop:
                    this.CssStyleName = "margin-top";
                    break;
                case HtmlTextWriterStyle.Overflow:
                    this.CssStyleName = "overflow";
                    break;
                case HtmlTextWriterStyle.OverflowX:
                    this.CssStyleName = "overflowX";
                    break;
                case HtmlTextWriterStyle.OverflowY:
                    this.CssStyleName = "overflowY";
                    break;
                case HtmlTextWriterStyle.Padding:
                    this.CssStyleName = "padding";
                    break;
                case HtmlTextWriterStyle.PaddingBottom:
                    this.CssStyleName = "padding-bottom";
                    break;
                case HtmlTextWriterStyle.PaddingLeft:
                    this.CssStyleName = "padding-left";
                    break;
                case HtmlTextWriterStyle.PaddingRight:
                    this.CssStyleName = "padding-right";
                    break;
                case HtmlTextWriterStyle.PaddingTop:
                    this.CssStyleName = "padding-top";
                    break;
                case HtmlTextWriterStyle.Position:
                    this.CssStyleName = "position";
                    break;
                case HtmlTextWriterStyle.TextAlign:
                    this.CssStyleName = "text-align";
                    break;
                case HtmlTextWriterStyle.TextDecoration:
                    this.CssStyleName = "text-decoration";
                    break;
                case HtmlTextWriterStyle.TextOverflow:
                    this.CssStyleName = "text-overflow";
                    break;
                case HtmlTextWriterStyle.Top:
                    this.CssStyleName = "top";
                    break;
                case HtmlTextWriterStyle.VerticalAlign:
                    this.CssStyleName = "vertical-align";
                    break;
                case HtmlTextWriterStyle.Visibility:
                    this.CssStyleName = "visibility";
                    break;
                case HtmlTextWriterStyle.WhiteSpace:
                    this.CssStyleName = "white-space";
                    break;
                case HtmlTextWriterStyle.Width:
                    this.CssStyleName = "width";
                    break;
                case HtmlTextWriterStyle.ZIndex:
                    this.CssStyleName = "z-index";
                    break;
                default:
                    break;
            }

            DomStyleName = StringExtensions.PascalCase(style.ToString());
        }
开发者ID:BryanApellanes,项目名称:Naizari,代码行数:101,代码来源:StyleConversion.cs


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