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

C# StylesheetParser类代码示例

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

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



StylesheetParser类属于命名空间,在下文中一共展示了StylesheetParser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:7,代码来源:AttributeTestFixture.cs


示例2: ExCSSFixture

        public ExCSSFixture()
        {
            _parser = new StylesheetParser();

            //new StylesheetParser().Parse(".big{color: red;}");
            //new StylesheetParser().Parse("@import \"mystyle.css\";");
        }
开发者ID:RussPAll,项目名称:ExCSS,代码行数:7,代码来源:StylesheetParserFixture.cs


示例3: 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);
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:7,代码来源:AttributeTestFixture.cs


示例4: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:8,代码来源:AttributeTestFixture.cs


示例5: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:8,代码来源:AttributeTestFixture.cs


示例6: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:8,代码来源:AttributeTestFixture.cs


示例7: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:9,代码来源:AttributeTestFixture.cs


示例8: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例9: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例10: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例11: StylesheetParser

        public void background_CCC_transparent_urlimagesimgpng_fixed_repeat_x_repeat_y_no_repeat_top_left_center_right_bottom_1px_2px()
        {
            var termParts = new[]{"#CCC","transparent","url(images/img.png)","fixed","repeat-x","repeat-y","no-repeat","top","left","center","right","bottom","1px","2px"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{background: #CCC transparent url(images/img.png) fixed repeat-x repeat-y no-repeat top left center right bottom 1px 2px }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("#CCC", expression.Terms[0].ToString());
            Assert.AreEqual("transparent", expression.Terms[1].ToString());
            Assert.AreEqual("url(images/img.png)", expression.Terms[2].ToString());
            Assert.AreEqual("fixed", expression.Terms[3].ToString());
            Assert.AreEqual("repeat-x", expression.Terms[4].ToString());
            Assert.AreEqual("repeat-y", expression.Terms[5].ToString());
            Assert.AreEqual("no-repeat", expression.Terms[6].ToString());
            Assert.AreEqual("top", expression.Terms[7].ToString());
            Assert.AreEqual("left", expression.Terms[8].ToString());
            Assert.AreEqual("center", expression.Terms[9].ToString());
            Assert.AreEqual("right", expression.Terms[10].ToString());
            Assert.AreEqual("bottom", expression.Terms[11].ToString());
            Assert.AreEqual("1px", expression.Terms[12].ToString());
            Assert.AreEqual("2px", expression.Terms[13].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:23,代码来源:AttributeTestFixture.generated.cs


示例12: border_left_1px_none

        public void border_left_1px_none()
        {
            var termParts = new[]{"1px","none"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{border-left: 1px none }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("1px", expression.Terms[0].ToString());
            Assert.AreEqual("none", expression.Terms[1].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:11,代码来源:AttributeTestFixture.generated.cs


示例13: z_index__1

        public void z_index__1()
        {
            var termParts = new[]{"-1"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{z-index: -1 }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("-1", expression.Terms[0].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例14: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例15: text_transform_capitalize

        public void text_transform_capitalize()
        {
            var termParts = new[]{"capitalize"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{text-transform: capitalize }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("capitalize", expression.Terms[0].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例16: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例17: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:12,代码来源:AttributeTestFixture.generated.cs


示例18: 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());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例19: vertical_align_text_top

        public void vertical_align_text_top()
        {
            var termParts = new[]{"text-top"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{vertical-align: text-top }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("text-top", expression.Terms[0].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs


示例20: visibility_hidden

        public void visibility_hidden()
        {
            var termParts = new[]{"hidden"};
            var parser = new StylesheetParser();
            var style = parser.Parse("*{visibility: hidden }");
            var expression = style.RuleSets[0].Declarations[0].Expression;

            Assert.AreEqual(termParts.Length, expression.Terms.Count);
            Assert.AreEqual("hidden", expression.Terms[0].ToString());
        }
开发者ID:Piedone,项目名称:ExCSS,代码行数:10,代码来源:AttributeTestFixture.generated.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# StylusPointCollection类代码示例发布时间:2022-05-24
下一篇:
C# Styles类代码示例发布时间: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