本文整理汇总了C#中System.Xml.XmlReaderSettings.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReaderSettings.Clone方法的具体用法?C# XmlReaderSettings.Clone怎么用?C# XmlReaderSettings.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlReaderSettings
的用法示例。
在下文中一共展示了XmlReaderSettings.Clone方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryReaderSettings
public QueryReaderSettings(XmlReader reader)
{
#pragma warning disable 618
XmlValidatingReader valReader = reader as XmlValidatingReader;
#pragma warning restore 618
if (valReader != null)
{
// Unwrap validation reader
_validatingReader = true;
reader = valReader.Impl.Reader;
}
_xmlReaderSettings = reader.Settings;
if (_xmlReaderSettings != null)
{
_xmlReaderSettings = _xmlReaderSettings.Clone();
_xmlReaderSettings.NameTable = reader.NameTable;
_xmlReaderSettings.CloseInput = true;
_xmlReaderSettings.LineNumberOffset = 0;
_xmlReaderSettings.LinePositionOffset = 0;
XmlTextReaderImpl impl = reader as XmlTextReaderImpl;
if (impl != null)
{
_xmlReaderSettings.XmlResolver = impl.GetResolver();
}
}
else
{
_xmlNameTable = reader.NameTable;
XmlTextReader xmlTextReader = reader as XmlTextReader;
if (xmlTextReader != null)
{
XmlTextReaderImpl impl = xmlTextReader.Impl;
_entityHandling = impl.EntityHandling;
_namespaces = impl.Namespaces;
_normalization = impl.Normalization;
_prohibitDtd = (impl.DtdProcessing == DtdProcessing.Prohibit);
_whitespaceHandling = impl.WhitespaceHandling;
_xmlResolver = impl.GetResolver();
}
else
{
_entityHandling = EntityHandling.ExpandEntities;
_namespaces = true;
_normalization = true;
_prohibitDtd = true;
_whitespaceHandling = WhitespaceHandling.All;
_xmlResolver = null;
}
}
}
示例2: XmlFilterReader
public XmlFilterReader (XmlReader reader, XmlReaderSettings settings)
{
this.reader = reader;
this.settings = settings.Clone ();
this.lineInfo = reader as IXmlLineInfo;
}
示例3: PopulateSettings
static XmlReaderSettings PopulateSettings (XmlReader reader, XmlReaderSettings src)
{
XmlReaderSettings copy;
if (src == null)
copy = new XmlReaderSettings ();
else
copy = src.Clone ();
#if NET_4_5
if (reader.Settings != null)
copy.Async = reader.Settings.Async;
copy.SetReadOnly ();
#endif
return copy;
}
示例4: PopulateSettings
static XmlReaderSettings PopulateSettings (XmlReaderSettings src)
{
if (src == null)
return new XmlReaderSettings ();
else
return src.Clone ();
}
示例5: AsyncPropagation
public void AsyncPropagation ()
{
var s = new XmlReaderSettings ();
s.Async = true;
var r = XmlReader.Create (new StringReader ("<root/>"), s);
var c = s.Clone ();
Assert.IsTrue (c.Async);
c.Reset ();
Assert.IsFalse (c.Async);
var r2 = XmlReader.Create (r, c);
Assert.IsTrue (r2.Settings.Async);
}
示例6: v4
public int v4()
{
XmlReaderSettings rs = new XmlReaderSettings();
XmlReaderSettings crs = rs.Clone();
CError.Compare(rs.CheckCharacters, crs.CheckCharacters, "CheckCharacters");
CError.Compare(rs.CloseInput, crs.CloseInput, "CloseInput");
CError.Compare(rs.DtdProcessing, crs.DtdProcessing, "ProhibitDtd");
CError.Compare(rs.IgnoreComments, crs.IgnoreComments, "IgnoreComments");
CError.Compare(rs.IgnoreProcessingInstructions, crs.IgnoreProcessingInstructions, "IgnorePI");
CError.Compare(rs.IgnoreWhitespace, crs.IgnoreWhitespace, "IgnoreWhitespace");
CError.Compare(rs.LineNumberOffset, crs.LineNumberOffset, "LineNumberOffset");
CError.Compare(rs.LinePositionOffset, crs.LinePositionOffset, "LinePositionOffset");
CError.Compare(rs.MaxCharactersInDocument, crs.MaxCharactersInDocument, "maxcharsindoc");
CError.Compare(rs.NameTable, crs.NameTable, "NameTable");
CError.Compare(rs.ConformanceLevel, crs.ConformanceLevel, "ConformanceLevel");
CError.Compare(rs.GetType(), crs.GetType(), "GetType");
return TEST_PASS;
}