当前位置: 首页>>代码示例>>C#>>正文


C# XmlReaderSettings.Clone方法代码示例

本文整理汇总了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;
                }
            }
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:50,代码来源:QueryReaderSettings.cs

示例2: XmlFilterReader

		public XmlFilterReader (XmlReader reader, XmlReaderSettings settings)
		{
			this.reader = reader;
			this.settings = settings.Clone ();
			this.lineInfo = reader as IXmlLineInfo;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:6,代码来源:XmlFilterReader.cs

示例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;
		}
开发者ID:carrie901,项目名称:mono,代码行数:14,代码来源:XmlReader.cs

示例4: PopulateSettings

		static XmlReaderSettings PopulateSettings (XmlReaderSettings src)
		{
			if (src == null)
				return new XmlReaderSettings ();
			else
				return src.Clone ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:XmlReader.cs

示例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);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:14,代码来源:XmlReaderSettingsTests.cs

示例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;
 }
开发者ID:jmhardison,项目名称:corefx,代码行数:18,代码来源:ReaderSettings.cs


注:本文中的System.Xml.XmlReaderSettings.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。