當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。