本文整理汇总了C#中Xml.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Xml.ToString方法的具体用法?C# Xml.ToString怎么用?C# Xml.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertTargetArchitectureAttribute
public static TargetArchitecture ConvertTargetArchitectureAttribute(Xml.LaunchOptions.TargetArchitecture source)
{
switch (source)
{
case Xml.LaunchOptions.TargetArchitecture.X86:
case Xml.LaunchOptions.TargetArchitecture.x86:
return TargetArchitecture.X86;
case Xml.LaunchOptions.TargetArchitecture.arm:
case Xml.LaunchOptions.TargetArchitecture.ARM:
return TargetArchitecture.ARM;
case Xml.LaunchOptions.TargetArchitecture.mips:
case Xml.LaunchOptions.TargetArchitecture.MIPS:
return TargetArchitecture.Mips;
case Xml.LaunchOptions.TargetArchitecture.x64:
case Xml.LaunchOptions.TargetArchitecture.amd64:
case Xml.LaunchOptions.TargetArchitecture.x86_64:
case Xml.LaunchOptions.TargetArchitecture.X64:
case Xml.LaunchOptions.TargetArchitecture.AMD64:
case Xml.LaunchOptions.TargetArchitecture.X86_64:
return TargetArchitecture.X64;
case Xml.LaunchOptions.TargetArchitecture.arm64:
case Xml.LaunchOptions.TargetArchitecture.ARM64:
return TargetArchitecture.ARM64;
default:
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, MICoreResources.Error_UnknownTargetArchitecture, source.ToString()));
}
}
示例2: Xml_ToString_IndentTrue_UsingUtf8_NoDeclaration_OutputsProperString
public void Xml_ToString_IndentTrue_UsingUtf8_NoDeclaration_OutputsProperString()
{
var xml = new Xml();
xml.Tag("outer", Xml.Fragment(() => xml.Tag("inner")));
Assert.Equal("<outer>\r\n <inner />\r\n</outer>", xml.ToString(true));
}
示例3: Xml_ToString_IndentTrue_UsingUtf8_WithDeclaration_OutputsProperString
public void Xml_ToString_IndentTrue_UsingUtf8_WithDeclaration_OutputsProperString()
{
var xml = new Xml();
xml.Declaration(encoding: "utf-8");
xml.Tag("outer", Xml.Fragment(() => xml.Tag("inner")));
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<outer>\r\n <inner />\r\n</outer>", xml.ToString(true));
}
示例4: Xml_ToString_IndentFalse_UsingUtf16_WithDeclaration_OutputsProperString
public void Xml_ToString_IndentFalse_UsingUtf16_WithDeclaration_OutputsProperString()
{
var xml = new Xml();
xml.Declaration(encoding: "utf-16");
xml.Tag("outer", Xml.Fragment(() => xml.Tag("inner")));
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-16\"?><outer><inner /></outer>", xml.ToString(false));
}