本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
示例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);
}