本文整理匯總了C#中System.Xml.XmlTextReaderImpl.Close方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlTextReaderImpl.Close方法的具體用法?C# XmlTextReaderImpl.Close怎麽用?C# XmlTextReaderImpl.Close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlTextReaderImpl
的用法示例。
在下文中一共展示了XmlTextReaderImpl.Close方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ParseXmlDeclarationValue
#pragma warning restore 618
internal static void ParseXmlDeclarationValue(string strValue, out string version, out string encoding, out string standalone)
{
version = null;
encoding = null;
standalone = null;
XmlTextReaderImpl tempreader = new XmlTextReaderImpl(strValue, (XmlParserContext)null);
try
{
tempreader.Read();
//get version info.
if (tempreader.MoveToAttribute(nameof(version)))
version = tempreader.Value;
//get encoding info
if (tempreader.MoveToAttribute(nameof(encoding)))
encoding = tempreader.Value;
//get standalone info
if (tempreader.MoveToAttribute(nameof(standalone)))
standalone = tempreader.Value;
}
finally
{
tempreader.Close();
}
}
示例2: LoadDocument
//
// Input documents management
//
internal static XPathDocument LoadDocument(XmlTextReaderImpl reader)
{
reader.EntityHandling = EntityHandling.ExpandEntities;
reader.XmlValidatingReaderCompatibilityMode = true;
try
{
return new XPathDocument(reader, XmlSpace.Preserve);
}
finally
{
reader.Close();
}
}
示例3: ParseXmlDeclarationValue
internal static void ParseXmlDeclarationValue(string strValue, out string version, out string encoding, out string standalone)
{
version = null;
encoding = null;
standalone = null;
XmlTextReaderImpl impl = new XmlTextReaderImpl(strValue, null);
try
{
impl.Read();
if (impl.MoveToAttribute("version"))
{
version = impl.Value;
}
if (impl.MoveToAttribute("encoding"))
{
encoding = impl.Value;
}
if (impl.MoveToAttribute("standalone"))
{
standalone = impl.Value;
}
}
finally
{
impl.Close();
}
}