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


C# Body.ToString方法代码示例

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


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

示例1: AddTag_ToString_RetrnTagWhithChild

        public void AddTag_ToString_RetrnTagWhithChild()
        {
            Body b = new Body();
            b.AddTag("tagname");
            string html = b.ToString();

            string expected = "<body><tagname></tagname></body>";
            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:9,代码来源:BodyTests.cs

示例2: AddAttribute_ToString_TagWithAttribute

        public void AddAttribute_ToString_TagWithAttribute()
        {
            Body b = new Body();
            b.AddAttribute("attname", "val");
            string html = b.ToString();

            string expected = "<body attname=\"val\"></body>";
            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:9,代码来源:BodyTests.cs

示例3: AddTWoAttributes_ToString_TagWithAttributes

        public void AddTWoAttributes_ToString_TagWithAttributes()
        {
            Body b = new Body();
            b.AddAttribute("first", "val1");
            b.AddAttribute("second", "val2");
            string html = b.ToString();

            string expected = "<body first=\"val1\" second=\"val2\"></body>";
            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:10,代码来源:BodyTests.cs

示例4: AddClass_ToString_ReturnsTagWithClassAtribute

        public void AddClass_ToString_ReturnsTagWithClassAtribute()
        {
            Body b = new Body();
            b.AddClass("classname");

            string html = b.ToString();
            string expected = "<body class=\"classname\"></body>";

            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:10,代码来源:BodyTests.cs

示例5: AddClassAddAttribute_ToString_TagWithClassesAndAttributes

        public void AddClassAddAttribute_ToString_TagWithClassesAndAttributes()
        {
            Body b = new Body();
            b.AddClass("one");
            b.AddAttribute("first", "val1");
            string html = b.ToString();

            string expected = "<body class=\"one\" first=\"val1\"></body>";
            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:10,代码来源:BodyTests.cs

示例6: DrawBody

        void DrawBody(Body body, Brush brush)
        {
            Debug.WriteLine("Body ID: {0} : {1}", body.ToString(), body.TrackingId);

            foreach (var entry in body.Joints)
            {
                JointType jointType = entry.Key;
                Joint joint = entry.Value;

                if (joint.TrackingState != TrackingState.NotTracked)
                {
                    Point position2d = this.MapPointToCanvasSpace(joint.Position);

                    if (!double.IsInfinity(position2d.X) && !double.IsInfinity(position2d.Y))
                    {
                        Ellipse ellipse =
                          this.MakeEllipseForJoint(jointType, joint.TrackingState, brush, position2d);

                        this.canvas.Children.Add(ellipse);
                    }
                }
            }
        }
开发者ID:RAGNOARAKNOS,项目名称:RecognitionHack,代码行数:23,代码来源:BodyFrameImageControl.xaml.cs

示例7: CreateBody_ToString_ReturnsEmptyTag

        public void CreateBody_ToString_ReturnsEmptyTag()
        {
            Body body = new Body();

            string actual = body.ToString();
            string expected = "<body></body>";

            Assert.AreEqual(expected, actual);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:9,代码来源:BodyTests.cs

示例8: AddTwoClasses_ToString_RetuwnsTagWithTwoClasses

        public void AddTwoClasses_ToString_RetuwnsTagWithTwoClasses()
        {
            Body b = new Body();
            b.AddClass("one");
            b.AddClass("two");

            string html = b.ToString();
            string expected = "<body class=\"one two\"></body>";
            Assert.AreEqual(expected, html);
        }
开发者ID:chumak84,项目名称:easygoing-html-builder,代码行数:10,代码来源:BodyTests.cs


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