本文整理汇总了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();
}
示例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());
}