本文整理汇总了C#中System.Web.UI.WebControls.Style.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# Style.Reset方法的具体用法?C# Style.Reset怎么用?C# Style.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Style
的用法示例。
在下文中一共展示了Style.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Style_GetStyleAttributes
public void Style_GetStyleAttributes () {
Style s;
CssStyleCollection css;
s = new Style ();
css = s.GetStyleAttributes (null);
Assert.AreEqual (0, css.Count, "GetStyleAttributes#1");
s.Font.Bold = true;
s.Font.Italic = true;
s.Font.Size = 10;
s.Font.Names = new string [] { "Arial", "Veranda" };
s.Font.Overline = true;
s.Font.Strikeout = true;
s.Font.Underline = true;
css = s.GetStyleAttributes (null);
Assert.AreEqual ("bold", css ["font-weight"], "GetStyleAttributes#2");
Assert.AreEqual ("italic", css ["font-style"], "GetStyleAttributes#3");
Assert.AreEqual ("10pt", css ["font-size"], "GetStyleAttributes#4");
Assert.AreEqual ("Arial,Veranda", css ["font-family"], "GetStyleAttributes#5");
Assert.AreEqual (true, css ["text-decoration"].Contains ("overline"), "GetStyleAttributes#6");
Assert.AreEqual (true, css ["text-decoration"].Contains ("line-through"), "GetStyleAttributes#7");
Assert.AreEqual (true, css ["text-decoration"].Contains ("underline"), "GetStyleAttributes#8");
s.Font.Names = null;
css = s.GetStyleAttributes (null);
Assert.AreEqual (null, css ["font-family"], "GetStyleAttributes#9");
s.Font.Name = "Arial, Veranda";
css = s.GetStyleAttributes (null);
Assert.AreEqual ("Arial, Veranda", css ["font-family"], "GetStyleAttributes#10");
s.Font.Name = "";
css = s.GetStyleAttributes (null);
Assert.AreEqual (null, css ["font-family"], "GetStyleAttributes#11");
s.Font.Bold = false;
s.Font.Italic = false;
s.Font.Size = FontUnit.Empty;
s.Font.Overline = false;
s.Font.Strikeout = false;
s.Font.Underline = false;
css = s.GetStyleAttributes (null);
Assert.AreEqual ("normal", css ["font-weight"], "GetStyleAttributes#12");
Assert.AreEqual ("normal", css ["font-style"], "GetStyleAttributes#13");
Assert.AreEqual (null, css ["font-size"], "GetStyleAttributes#14");
Assert.AreEqual ("none", css ["text-decoration"], "GetStyleAttributes#15");
s.Reset ();
css = s.GetStyleAttributes (null);
Assert.AreEqual (0, css.Count, "GetStyleAttributes#16");
s.Reset ();
s.Font.Underline = false;
css = s.GetStyleAttributes (null);
Assert.AreEqual ("none", css ["text-decoration"], "GetStyleAttributes#17");
s.Reset ();
s.BorderWidth = 1;
s.BorderStyle = BorderStyle.Dashed;
css = s.GetStyleAttributes (null);
Assert.AreEqual ("Dashed", css ["border-style"], "GetStyleAttributes#18");
Assert.AreEqual ("1px", css ["border-width"], "GetStyleAttributes#19");
s.BorderStyle = BorderStyle.NotSet;
css = s.GetStyleAttributes (null);
Assert.AreEqual ("solid", css ["border-style"], "GetStyleAttributes#20");
Assert.AreEqual ("1px", css ["border-width"], "GetStyleAttributes#21");
s.BorderWidth = 0;
css = s.GetStyleAttributes (null);
Assert.AreEqual (null, css ["border-style"], "GetStyleAttributes#22");
Assert.AreEqual ("0px", css ["border-width"], "GetStyleAttributes#23");
}