本文整理汇总了C#中StylesheetParser.Parse方法的典型用法代码示例。如果您正苦于以下问题:C# StylesheetParser.Parse方法的具体用法?C# StylesheetParser.Parse怎么用?C# StylesheetParser.Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StylesheetParser
的用法示例。
在下文中一共展示了StylesheetParser.Parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Zero_Values_Before_Decimals_Are_Parsed
public void Zero_Values_Before_Decimals_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{ background-position: 0 1.1em; }");
Assert.AreEqual(1, style.RuleSets[0].Declarations.Count);
}
示例2: Empty_Terms_Are_Ignored
public void Empty_Terms_Are_Ignored()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{ font-size: 10px; ; }");
Assert.AreEqual(1, style.RuleSets[0].Declarations.Count);
}
示例3: Terms_With_Vendor_Functions_Are_Parsed
public void Terms_With_Vendor_Functions_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{background-image: -moz-linear-gradient(top,#CCC,#ddd) }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("-moz-linear-gradient(top, #CCC, #DDD)", expression.Terms[0].ToString());
}
示例4: Terms_With_Size_And_Height_Shorthand_Are_Parsed
public void Terms_With_Size_And_Height_Shorthand_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{font-size: 12px/20px }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("12px/20px", expression.Terms[0].ToString());
}
示例5: Content_With_Empty_Single_Quote_Strings_Is_Parsed
public void Content_With_Empty_Single_Quote_Strings_Is_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{content: ' ' }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual("' '", expression.Terms[0].ToString());
}
示例6: Terms_With_Functions_Are_Parsed
public void Terms_With_Functions_Are_Parsed()
{
var parser = new StylesheetParser();
var style = parser.Parse("*{clip: rect(0px,60px,200px,0px) }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(1, expression.Terms.Count);
Assert.AreEqual("rect(0px, 60px, 200px, 0px)", expression.Terms[0].ToString());
}
示例7: accelerator_true
public void accelerator_true()
{
var termParts = new[]{"true"};
var parser = new StylesheetParser();
var style = parser.Parse("*{accelerator: true }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("true", expression.Terms[0].ToString());
}
示例8: background_attachment_scroll
public void background_attachment_scroll()
{
var termParts = new[]{"scroll"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background-attachment: scroll }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("scroll", expression.Terms[0].ToString());
}
示例9: azimuth_left_side
public void azimuth_left_side()
{
var termParts = new[]{"left-side"};
var parser = new StylesheetParser();
var style = parser.Parse("*{azimuth: left-side }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("left-side", expression.Terms[0].ToString());
}
示例10: white_space_pre_line
public void white_space_pre_line()
{
var termParts = new[]{"pre-line"};
var parser = new StylesheetParser();
var style = parser.Parse("*{white-space: pre-line }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("pre-line", expression.Terms[0].ToString());
}
示例11: border_bottom_solid
public void border_bottom_solid()
{
var termParts = new[]{"solid"};
var parser = new StylesheetParser();
var style = parser.Parse("*{border-bottom: solid }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("solid", expression.Terms[0].ToString());
}
示例12: background_transparent_0_0
public void background_transparent_0_0()
{
var termParts = new[]{"transparent","0","0"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background: transparent 0 0 }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("transparent", expression.Terms[0].ToString());
Assert.AreEqual("0", expression.Terms[1].ToString());
Assert.AreEqual("0", expression.Terms[2].ToString());
}
示例13: background_repeat_repeat_y
public void background_repeat_repeat_y()
{
var termParts = new[]{"repeat-y"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background-repeat: repeat-y }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("repeat-y", expression.Terms[0].ToString());
}
示例14: text_indent_5px
public void text_indent_5px()
{
var termParts = new[]{"5px"};
var parser = new StylesheetParser();
var style = parser.Parse("*{text-indent: 5px }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("5px", expression.Terms[0].ToString());
}
示例15: background_position_x_inherit
public void background_position_x_inherit()
{
var termParts = new[]{"inherit"};
var parser = new StylesheetParser();
var style = parser.Parse("*{background-position-x: inherit }");
var expression = style.RuleSets[0].Declarations[0].Expression;
Assert.AreEqual(termParts.Length, expression.Terms.Count);
Assert.AreEqual("inherit", expression.Terms[0].ToString());
}