• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ConformanceLevel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ConformanceLevel的典型用法代码示例。如果您正苦于以下问题:C# ConformanceLevel类的具体用法?C# ConformanceLevel怎么用?C# ConformanceLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConformanceLevel类属于命名空间,在下文中一共展示了ConformanceLevel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MwsXmlBuilder

 public MwsXmlBuilder(bool toWrap, ConformanceLevel conformanceLevel)
 {
     builder = new StringBuilder();
     XmlWriterSettings settings = new XmlWriterSettings();
     settings.OmitXmlDeclaration = !toWrap;
     settings.ConformanceLevel = conformanceLevel;
     writer = XmlWriter.Create(builder, settings);
 }
开发者ID:verveinfotech,项目名称:Innoventory,代码行数:8,代码来源:MwsXmlBuilder.cs


示例2: CheckReaderSettings

		private static void CheckReaderSettings(XmlReaderSettings settings, ConformanceLevel expectedConformanceLevel)
		{
			Assert.IsFalse(settings.CheckCharacters);
#if NET_4_0 && !__MonoCS__
			Assert.AreEqual(DtdProcessing.Parse, settings.DtdProcessing);
#else
			Assert.IsTrue(settings.ProhibitDtd);
#endif
			Assert.AreEqual(ValidationType.None , settings.ValidationType);
			Assert.IsTrue(settings.CloseInput);
			Assert.IsTrue(settings.IgnoreWhitespace);
			Assert.AreEqual(expectedConformanceLevel, settings.ConformanceLevel);
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:13,代码来源:CanonicalXmlSettingsTests.cs


示例3: Reset

		public void Reset()
		{
			checkCharacters = true;
			closeOutput = false;
			conformance = ConformanceLevel.Document;
			encoding = Encoding.UTF8;
			indent = false;
			indentChars = "  ";
			newLineChars = Environment.NewLine;
			newLineOnAttributes = false;
			newLineHandling = NewLineHandling.Replace;
			normalizeNewLines = true;
			omitXmlDeclaration = false;
			outputMethod = XmlOutputMethod.AutoDetect;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:15,代码来源:XmlWriterSettings.cs


示例4: Reset

		public void Reset ()
		{
			checkCharacters = true;
			closeOutput = false; // ? not documented
			conformance = ConformanceLevel.Document;
			encoding = Encoding.UTF8;
			indent = false;
			indentChars = "  ";
			// LAMESPEC: MS.NET says it is "\r\n", but it is silly decision.
			newLineChars = Environment.NewLine;
			newLineOnAttributes = false;
			newLineHandling = NewLineHandling.None;
			omitXmlDeclaration = false;
			outputMethod = XmlOutputMethod.AutoDetect;
		}
开发者ID:desunit,项目名称:Mono-Class-Libraries,代码行数:15,代码来源:XmlWriterSettings.cs


示例5: Reset

		public void Reset ()
		{
			checkCharacters = true;
			closeOutput = false; // ? not documented
			conformance = ConformanceLevel.Document;
			encoding = Encoding.UTF8;
			indent = false;
			indentChars = "  ";
			newLineChars = "\r\n";
			newLineOnAttributes = false;
			newLineHandling = NewLineHandling.Replace;
			omitXmlDeclaration = false;
			outputMethod = XmlOutputMethod.AutoDetect;
#if NET_4_5
			isAsync = false;
#endif
		}
开发者ID:carrie901,项目名称:mono,代码行数:17,代码来源:XmlWriterSettings.cs


示例6: CreateXmlWriterSettings

		///<summary>
		/// Return an XmlWriterSettings suitable for use in Chorus applications.
		///</summary>
		/// <remarks>
		/// This formats with new line on attributes, indents with tab, and encoded in UTF8 with no BOM.
		/// </remarks>
		/// <param name="conformanceLevel">Document|Fragment</param>
		///<returns>XmlWriterSettings</returns>
		public static XmlWriterSettings CreateXmlWriterSettings(ConformanceLevel conformanceLevel)
		{
			var settings = new XmlWriterSettings
							   {
								   NewLineOnAttributes = true,              // New line for each attribute, saves space on a typical Chorus changeset.
								   Indent = true,                           // Indent entities
								   IndentChars = "\t",                      // Tabs for the indent
								   CheckCharacters = false,
								   Encoding = new UTF8Encoding(false),      // UTF8 without a BOM.
								   CloseOutput = true,                      // Close the underlying stream on Close.  This is not the default.
								   ConformanceLevel = conformanceLevel,
								   NewLineChars = "\r\n",                   // Use /r/n for our end of lines
								   NewLineHandling = NewLineHandling.None,  // Assume that the input is as written /r/n
								   OmitXmlDeclaration = false               // The default, an xml declaration is written
							   };
			return settings;
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:25,代码来源:CanonicalXmlSettings.cs


示例7: CreateXmlReaderSettings

		///<summary>
		/// Return an XmlReaderSettings suitable for use in Chorus applications.
		///</summary>
		/// <remarks>
		/// This formats with:
		///		CheckCharacters as 'false',
		///		ProhibitDtd as 'true',
		///		ValidationType as ValidationType.None,
		///		CloseInput as 'true',
		///		IgnoreWhitespace as 'true', and
		///		ConformanceLevel as 'conformanceLevel' parameter.
		/// </remarks>
		/// <param name="conformanceLevel">Document|Fragment</param>
		///<returns>XmlReaderSettings</returns>
		public static XmlReaderSettings CreateXmlReaderSettings(ConformanceLevel conformanceLevel)
		{
			var settings = new XmlReaderSettings
			{
				CheckCharacters = false,
				ConformanceLevel = conformanceLevel,
#if NET_4_0 && !__MonoCS__
				DtdProcessing = DtdProcessing.Parse,
#else
				ProhibitDtd = true,
#endif
				ValidationType = ValidationType.None,
				CloseInput = true,
				IgnoreWhitespace = true
			};
			return settings;
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:31,代码来源:CanonicalXmlSettings.cs


示例8: Reset

		public void Reset ()
		{
			checkCharacters = true;
			closeInput = false; // ? not documented
			conformance = ConformanceLevel.Document;
			ignoreComments = false;
			ignoreProcessingInstructions = false;
			ignoreWhitespace = false;
			lineNumberOffset = 0;
			linePositionOffset = 0;
			prohibitDtd = true;
#if MOONLIGHT
			xmlResolver = new XmlXapResolver ();
#else
			schemas = null;
			schemasNeedsInitialization = true;
			validationFlags =
				XsValidationFlags.ProcessIdentityConstraints |
				XsValidationFlags.AllowXmlAttributes;
			validationType = ValidationType.None;
			xmlResolver = new XmlUrlResolver ();
#endif
		}
开发者ID:nkuln,项目名称:mono,代码行数:23,代码来源:XmlReaderSettings.cs


示例9: Initialize

        void Initialize(XmlResolver resolver) {
            nameTable = null;
#if !SILVERLIGHT
            if (!EnableLegacyXmlSettings())
            {
                xmlResolver = resolver;
                // limit the entity resolving to 10 million character. the caller can still
                // override it to any other value or set it to zero for unlimiting it
                maxCharactersFromEntities = (long) 1e7;
            }
            else
#endif            
            {
                xmlResolver = (resolver == null ? CreateDefaultResolver() : resolver);
                maxCharactersFromEntities = 0;
            }
            lineNumberOffset = 0;
            linePositionOffset = 0;
            checkCharacters = true;
            conformanceLevel = ConformanceLevel.Document;

            ignoreWhitespace = false;
            ignorePIs = false;
            ignoreComments = false;
            dtdProcessing = DtdProcessing.Prohibit;
            closeInput = false;

            maxCharactersInDocument = 0;

#if !SILVERLIGHT
            schemas = null;
            validationType = ValidationType.None;
            validationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints;
            validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;
#endif

#if ASYNC || FEATURE_NETCORE
            useAsync = false;
#endif

            isReadOnly = false;
#if !SILVERLIGHT
            IsXmlResolverSet = false;
#endif
        }
开发者ID:uQr,项目名称:referencesource,代码行数:45,代码来源:XmlReaderSettings.cs


示例10: Initialize

        //
        // Private methods
        //
        private void Initialize()
        {
            _encoding = Encoding.UTF8;
            _omitXmlDecl = false;
            _newLineHandling = NewLineHandling.Replace;
            _newLineChars = Environment.NewLine; // "\r\n" on Windows, "\n" on Unix
            _indent = TriState.Unknown;
            _indentChars = "  ";
            _newLineOnAttributes = false;
            _closeOutput = false;
            _namespaceHandling = NamespaceHandling.Default;
            _conformanceLevel = ConformanceLevel.Document;
            _checkCharacters = true;
            _writeEndDocumentOnClose = true;

            _outputMethod = XmlOutputMethod.Xml;
            _cdataSections.Clear();
            _mergeCDataSections = false;
            _mediaType = null;
            _docTypeSystem = null;
            _docTypePublic = null;
            _standalone = XmlStandalone.Omit;
            _doNotEscapeUriAttributes = false;

            _useAsync = false;
            _isReadOnly = false;
        }
开发者ID:geoffkizer,项目名称:corefx,代码行数:30,代码来源:XmlWriterSettings.cs


示例11: OnRootElement

 internal override void OnRootElement(ConformanceLevel currentConformanceLevel) { 
     // Just remember the current conformance level
     conformanceLevel = currentConformanceLevel;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:4,代码来源:XmlEncodedRawTextWriter.cs


示例12: Reset

//
// Public methods
//
        public void Reset() {
            CheckReadOnly( "Reset" );

            nameTable = null;
            xmlResolver = new XmlUrlResolver();
            lineNumberOffset = 0;
            linePositionOffset = 0;
            checkCharacters = true;
            conformanceLevel = ConformanceLevel.Document;

            schemas = null;
            validationType = ValidationType.None;
            validationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints;
            validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;
            ignoreWhitespace = false;
            ignorePIs = false;
            ignoreComments = false;
            prohibitDtd = true;
            closeInput = false;

            isReadOnly = false;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:25,代码来源:xmlreadersettings.cs


示例13: XmlParsingOptions

      public XmlParsingOptions() {

         this.ConformanceLevel = ConformanceLevel.Document;
         this.XmlResolver = new XmlDynamicResolver(Assembly.GetCallingAssembly());
      }
开发者ID:nuxleus,项目名称:Nuxleus,代码行数:5,代码来源:XmlParsingOptions.cs


示例14: CreateWriter

 public virtual XmlWriter CreateWriter(ConformanceLevel cl)
 {
     return this.XmlWriterTestModule.WriterFactory.CreateWriter(cl);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:4,代码来源:XmlWriterTestCaseBase.cs


示例15: Initialize

        private void Initialize(XmlResolver resolver)
        {
            _nameTable = null;
            if (!EnableLegacyXmlSettings())
            {
                _xmlResolver = resolver;
                // limit the entity resolving to 10 million character. the caller can still
                // override it to any other value or set it to zero for unlimiting it
                _maxCharactersFromEntities = (long)1e7;
            }
            else
            {
                _xmlResolver = (resolver == null ? CreateDefaultResolver() : resolver);
                _maxCharactersFromEntities = 0;
            }
            _lineNumberOffset = 0;
            _linePositionOffset = 0;
            _checkCharacters = true;
            _conformanceLevel = ConformanceLevel.Document;

            _ignoreWhitespace = false;
            _ignorePIs = false;
            _ignoreComments = false;
            _dtdProcessing = DtdProcessing.Prohibit;
            _closeInput = false;

            _maxCharactersInDocument = 0;

            _schemas = null;
            _validationType = ValidationType.None;
            _validationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints;
            _validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;

            _useAsync = false;

            _isReadOnly = false;
            IsXmlResolverSet = false;
        }
开发者ID:chcosta,项目名称:corefx,代码行数:38,代码来源:XmlReaderSettings.cs


示例16: XmlWellFormedWriter

        //
        // Constructor & finalizer
        //
        internal XmlWellFormedWriter(XmlWriter writer, XmlWriterSettings settings)
        {
            Debug.Assert(writer != null);
            Debug.Assert(settings != null);
            Debug.Assert(MaxNamespacesWalkCount <= 3);

            _writer = writer;

            _rawWriter = writer as XmlRawWriter;
            _predefinedNamespaces = writer as IXmlNamespaceResolver;
            if (_rawWriter != null)
            {
                _rawWriter.NamespaceResolver = new NamespaceResolverProxy(this);
            }

            _checkCharacters = settings.CheckCharacters;
            _omitDuplNamespaces = (settings.NamespaceHandling & NamespaceHandling.OmitDuplicates) != 0;
            _writeEndDocumentOnClose = settings.WriteEndDocumentOnClose;

            _conformanceLevel = settings.ConformanceLevel;
            _stateTable = (_conformanceLevel == ConformanceLevel.Document) ? s_stateTableDocument : s_stateTableAuto;

            _currentState = State.Start;

            _nsStack = new Namespace[NamespaceStackInitialSize];
            _nsStack[0].Set("xmlns", XmlReservedNs.NsXmlNs, NamespaceKind.Special);
            _nsStack[1].Set("xml", XmlReservedNs.NsXml, NamespaceKind.Special);
            if (_predefinedNamespaces == null)
            {
                _nsStack[2].Set(string.Empty, string.Empty, NamespaceKind.Implied);
            }
            else
            {
                string defaultNs = _predefinedNamespaces.LookupNamespace(string.Empty);
                _nsStack[2].Set(string.Empty, (defaultNs == null ? string.Empty : defaultNs), NamespaceKind.Implied);
            }
            _nsTop = 2;

            _elemScopeStack = new ElementScope[ElementStackInitialSize];
            _elemScopeStack[0].Set(string.Empty, string.Empty, string.Empty, _nsTop);
            _elemScopeStack[0].xmlSpace = XmlSpace.None;
            _elemScopeStack[0].xmlLang = null;
            _elemTop = 0;

            _attrStack = new AttrName[AttributeArrayInitialSize];

            _hasher = new SecureStringHasher();
        }
开发者ID:shiftkey-tester,项目名称:corefx,代码行数:51,代码来源:XmlWellformedWriter.cs


示例17: WriteStartDocumentImpl

        private void WriteStartDocumentImpl(XmlStandalone standalone)
        {
            try
            {
                AdvanceState(Token.StartDocument);

                if (_conformanceLevel == ConformanceLevel.Auto)
                {
                    _conformanceLevel = ConformanceLevel.Document;
                    _stateTable = s_stateTableDocument;
                }
                else if (_conformanceLevel == ConformanceLevel.Fragment)
                {
                    throw new InvalidOperationException(SR.Xml_CannotStartDocumentOnFragment);
                }

                if (_rawWriter != null)
                {
                    if (!_xmlDeclFollows)
                    {
                        _rawWriter.WriteXmlDeclaration(standalone);
                    }
                }
                else
                {
                    // We do not pass the standalone value here
                    _writer.WriteStartDocument();
                }
            }
            catch
            {
                _currentState = State.Error;
                throw;
            }
        }
开发者ID:shiftkey-tester,项目名称:corefx,代码行数:35,代码来源:XmlWellformedWriter.cs


示例18: Initialize

        void Initialize(XmlResolver resolver) {
            nameTable = null;
            xmlResolver = (resolver == null ? CreateDefaultResolver() : resolver);
            lineNumberOffset = 0;
            linePositionOffset = 0;
            checkCharacters = true;
            conformanceLevel = ConformanceLevel.Document;

            ignoreWhitespace = false;
            ignorePIs = false;
            ignoreComments = false;
            dtdProcessing = DtdProcessing.Prohibit;
            closeInput = false;

            maxCharactersFromEntities = 0;
            maxCharactersInDocument = 0;

#if !SILVERLIGHT
            schemas = null;
            validationType = ValidationType.None;
            validationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints;
            validationFlags |= XmlSchemaValidationFlags.AllowXmlAttributes;
#endif

#if ASYNC || FEATURE_NETCORE
            useAsync = false;
#endif

            isReadOnly = false;
#if !SILVERLIGHT
            IsXmlResolverSet = false;
#endif
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:33,代码来源:XmlReaderSettings.cs


示例19: GetXmlWriters

        private List<XmlWriter> GetXmlWriters(Encoding encoding, ConformanceLevel conformanceLevel)
        {
            var xmlWriters = new List<XmlWriter>();
            int count = 0;

            var s = new XmlWriterSettings();
            s.CheckCharacters = true;
            s.Encoding = encoding;

            var ws = new XmlWriterSettings();
            ws.CheckCharacters = false;
            // Set it to true when FileIO is ok
            ws.CloseOutput = false;
            ws.Encoding = encoding;

            s.ConformanceLevel = conformanceLevel;
            ws.ConformanceLevel = conformanceLevel;

            TextWriter tw = new StreamWriter(FilePathUtil.getStream(GenerateTestFileName(count++)));
            xmlWriters.Add(new CoreXml.Test.XLinq.CustomWriter(tw, ws)); // CustomWriter                  
            xmlWriters.Add(XmlWriter.Create(FilePathUtil.getStream(GenerateTestFileName(count++)), s)); // Factory XmlWriter       
            xmlWriters.Add(XmlWriter.Create(FilePathUtil.getStream(GenerateTestFileName(count++)), ws)); // Factory Writer   

            return xmlWriters;
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:25,代码来源:SaveWithWriter.cs


示例20: OnRootElement

 // Called before a root element is written (before the WriteStartElement call)
 //   the conformanceLevel specifies the current conformance level the writer is operating with.
 internal virtual void OnRootElement(ConformanceLevel conformanceLevel) { }
开发者ID:uQr,项目名称:referencesource,代码行数:3,代码来源:XmlRawWriter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Connect类代码示例发布时间:2022-05-24
下一篇:
C# ConfiguredEndpoint类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap