本文整理匯總了C#中System.Xml.Linq.XStreamingElement.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# XStreamingElement.ToString方法的具體用法?C# XStreamingElement.ToString怎麽用?C# XStreamingElement.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.Linq.XStreamingElement
的用法示例。
在下文中一共展示了XStreamingElement.ToString方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ToString
public void ToString ()
{
var el = new XStreamingElement ("foo",
new XAttribute ("bar", "baz"),
"text");
Assert.AreEqual ("<foo bar=\"baz\">text</foo>", el.ToString ());
}
示例2: ToStringAttributeAfterText
public void ToStringAttributeAfterText ()
{
var el = new XStreamingElement ("foo",
"text",
new XAttribute ("bar", "baz"));
el.ToString ();
}
示例3: XNameConstructor
public void XNameConstructor()
{
XStreamingElement streamElement = new XStreamingElement("contact");
Assert.Equal("<contact />", streamElement.ToString());
}
示例4: XNameAndNullObjectConstructor
public void XNameAndNullObjectConstructor()
{
XStreamingElement streamElement = new XStreamingElement("contact", null);
Assert.Equal("<contact />", streamElement.ToString());
}
示例5: AddWithNull
public void AddWithNull()
{
XStreamingElement streamElement = new XStreamingElement("contact");
streamElement.Add(null);
Assert.Equal("<contact />", streamElement.ToString());
}
示例6: XMLPropertyGet
public void XMLPropertyGet()
{
XElement contact = new XElement("contact", new XElement("phone", "925-555-0134"));
XStreamingElement streamElement = new XStreamingElement("contact", contact.Element("phone"));
Assert.Equal(contact.ToString(SaveOptions.None), streamElement.ToString(SaveOptions.None));
}
示例7: XNameConstructor
//[Variation(Priority = 0, Desc = "Constructor - XStreamingElement(XName)")]
public void XNameConstructor()
{
XStreamingElement streamElement = new XStreamingElement("contact");
if (!streamElement.ToString().Equals("<contact />"))
throw new TestFailedException("");
}
示例8: AddWithNull
//[Variation(Priority = 1, Desc = "Add(null)")]
public void AddWithNull()
{
XStreamingElement streamElement = new XStreamingElement("contact");
streamElement.Add(null);
if (!streamElement.ToString().Equals("<contact />"))
throw new TestFailedException("");
}
示例9: XMLPropertyGet
//[Variation(Priority = 0, Desc = "XML Property")]
public void XMLPropertyGet()
{
XElement contact = new XElement("contact", new XElement("phone", "925-555-0134"));
XStreamingElement streamElement = new XStreamingElement("contact", contact.Element("phone"));
if (!streamElement.ToString(SaveOptions.None).Equals(contact.ToString(SaveOptions.None)))
throw new TestFailedException("");
}