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


C# XmlSchemaObjectTable.Set方法代码示例

本文整理汇总了C#中System.Xml.Schema.XmlSchemaObjectTable.Set方法的典型用法代码示例。如果您正苦于以下问题:C# XmlSchemaObjectTable.Set方法的具体用法?C# XmlSchemaObjectTable.Set怎么用?C# XmlSchemaObjectTable.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.Schema.XmlSchemaObjectTable的用法示例。


在下文中一共展示了XmlSchemaObjectTable.Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToTable

		public static void AddToTable (XmlSchemaObjectTable table, XmlSchemaObject obj,
			XmlQualifiedName qname, ValidationEventHandler h)
		{
			if (table.Contains (qname)) {
				// FIXME: This logic unexpectedly allows 
				// one redefining item and two or more redefining items.
				// FIXME: redefining item is not simple replacement,
				// but much more complex stuff.
				if (obj.isRedefineChild) {	// take precedence.
					if (obj.redefinedObject != null)
						obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
					else
						obj.redefinedObject = table [qname];
					table.Set (qname, obj);
				}
				else if (table [qname].isRedefineChild) {
					if (table [qname].redefinedObject != null)
						obj.error (h, String.Format ("Named item {0} was already contained in the schema object table.", qname));
					else
						table [qname].redefinedObject = obj;
					return;	// never add to the table.
				}
				else if (StrictMsCompliant) {
					table.Set (qname, obj);
				}
				else
					obj.error (h, String.Format ("Named item {0} was already contained in the schema object table. {1}",
					                             qname, "Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation."));
			}
			else
				table.Set (qname, obj);
		}
开发者ID:carrie901,项目名称:mono,代码行数:32,代码来源:XmlSchemaUtil.cs

示例2: ValidateUPAOnItems

		void ValidateUPAOnItems (XmlSchemaObjectTable qnames, ArrayList nsNames,
			ValidationEventHandler h, XmlSchema schema)
		{
			// non-optional components
			XmlSchemaObjectTable elems = new XmlSchemaObjectTable ();
			ArrayList wildcards = new ArrayList ();
			XmlSchemaObjectTable tmpElems = new XmlSchemaObjectTable ();
			ArrayList tmpWildcards = new ArrayList ();
			for (int i=0; i<Items.Count; i++) {
				XmlSchemaParticle p1 = Items [i] as XmlSchemaParticle;
				p1.ValidateUniqueParticleAttribution (elems, wildcards, h, schema);
				if (p1.ValidatedMinOccurs == p1.ValidatedMaxOccurs) {
					elems.Clear ();
					wildcards.Clear ();
				}
				else {
					if (p1.ValidatedMinOccurs != 0) {
						foreach (XmlQualifiedName n in tmpElems.Names)
							elems.Set (n, null); // remove
						foreach (object o in tmpWildcards)
							wildcards.Remove (o);
					}
					foreach (XmlQualifiedName n in elems.Names)
						tmpElems.Set (n, elems [n]);
					tmpWildcards.Clear ();
					tmpWildcards.AddRange (wildcards);
				}
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:29,代码来源:XmlSchemaSequence.cs


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