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


C# XmlSchemaObjectTable.Add方法代码示例

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


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

示例1: AddToTable

 protected void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
 {
     if (qname.Name.Length != 0)
     {
         XmlSchemaObject existingObject = table[qname];
         if (existingObject != null)
         {
             if (existingObject != item)
             {
                 string code = "Sch_DupGlobalElement";
                 if (item is XmlSchemaAttributeGroup)
                 {
                     if (Ref.Equal(this.nameTable.Add(qname.Namespace), this.NsXml))
                     {
                         XmlSchemaObject obj3 = Preprocessor.GetBuildInSchema().AttributeGroups[qname];
                         if (existingObject == obj3)
                         {
                             table.Insert(qname, item);
                             return;
                         }
                         if (item == obj3)
                         {
                             return;
                         }
                     }
                     else if (this.IsValidAttributeGroupRedefine(existingObject, item, table))
                     {
                         return;
                     }
                     code = "Sch_DupAttributeGroup";
                 }
                 else if (item is XmlSchemaAttribute)
                 {
                     if (Ref.Equal(this.nameTable.Add(qname.Namespace), this.NsXml))
                     {
                         XmlSchemaObject obj4 = Preprocessor.GetBuildInSchema().Attributes[qname];
                         if (existingObject == obj4)
                         {
                             table.Insert(qname, item);
                             return;
                         }
                         if (item == obj4)
                         {
                             return;
                         }
                     }
                     code = "Sch_DupGlobalAttribute";
                 }
                 else if (item is XmlSchemaSimpleType)
                 {
                     if (this.IsValidTypeRedefine(existingObject, item, table))
                     {
                         return;
                     }
                     code = "Sch_DupSimpleType";
                 }
                 else if (item is XmlSchemaComplexType)
                 {
                     if (this.IsValidTypeRedefine(existingObject, item, table))
                     {
                         return;
                     }
                     code = "Sch_DupComplexType";
                 }
                 else if (item is XmlSchemaGroup)
                 {
                     if (this.IsValidGroupRedefine(existingObject, item, table))
                     {
                         return;
                     }
                     code = "Sch_DupGroup";
                 }
                 else if (item is XmlSchemaNotation)
                 {
                     code = "Sch_DupNotation";
                 }
                 else if (item is XmlSchemaIdentityConstraint)
                 {
                     code = "Sch_DupIdentityConstraint";
                 }
                 this.SendValidationEvent(code, qname.ToString(), item);
             }
         }
         else
         {
             table.Add(qname, item);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:89,代码来源:BaseProcessor.cs

示例2: AddToTable

 private bool AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item) {
     if (qname.Name.Length == 0) {
         return true;
     }
     XmlSchemaObject existingObject = (XmlSchemaObject)table[qname]; 
     if (existingObject != null) {
         if (existingObject == item || existingObject.SourceUri == item.SourceUri) {
             return true;
         }
         string code = string.Empty;
         if (item is XmlSchemaComplexType) {
             code = Res.Sch_DupComplexType;
         } 
         else if (item is XmlSchemaSimpleType) {
             code = Res.Sch_DupSimpleType;
         } 
         else if (item is XmlSchemaElement) {
             code = Res.Sch_DupGlobalElement;
         } 
         else if (item is XmlSchemaAttribute) {
             if (qname.Namespace == XmlReservedNs.NsXml) {
                 XmlSchema schemaForXmlNS = Preprocessor.GetBuildInSchema();
                 XmlSchemaObject builtInAttribute = schemaForXmlNS.Attributes[qname];
                 if (existingObject == builtInAttribute) { //replace built-in one
                     table.Insert(qname, item);
                     return true;
                 }
                 else if (item == builtInAttribute) { //trying to overwrite customer's component with built-in, ignore built-in
                     return true;
                 }
             }
             code = Res.Sch_DupGlobalAttribute;
         } 
         SendValidationEvent(new XmlSchemaException(code,qname.ToString()), XmlSeverityType.Error);
         return false;
     } 
     else {
         table.Add(qname, item);
         return true;
     }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:41,代码来源:xmlschemaset.cs

示例3: AddToTable

 private void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item) {
     if (qname.Name == string.Empty) {
         return;
     } 
     else if (table[qname] != null) {
         string code = Res.Sch_DupGlobalAttribute;
         if (item is XmlSchemaAttributeGroup) {
             code = Res.Sch_DupAttributeGroup;
         } 
         else if (item is XmlSchemaComplexType) {
             code = Res.Sch_DupComplexType;
         } 
         else if (item is XmlSchemaSimpleType) {
             code = Res.Sch_DupSimpleType;
         } 
         else if (item is XmlSchemaElement) {
             code = Res.Sch_DupGlobalElement;
         } 
         else if (item is XmlSchemaGroup) {
             code = Res.Sch_DupGroup;
         } 
         else if (item is XmlSchemaNotation) {
             code = Res.Sch_DupNotation;
         }
         SendValidationEvent(code, qname.ToString(), item);
     } 
     else {
         table.Add(qname, item);
     }
 }
开发者ID:ArildF,项目名称:masters,代码行数:30,代码来源:compiler.cs

示例4: AddToTable

 protected void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item) {
     if (qname.Name.Length == 0) {
         return;
     }
     XmlSchemaObject existingObject = (XmlSchemaObject)table[qname];
     
     if (existingObject != null) {
         if (existingObject == item) { 
             return;
         }
         string code = Res.Sch_DupGlobalElement; 
         if (item is XmlSchemaAttributeGroup) {
             string ns = nameTable.Add(qname.Namespace);
             if (Ref.Equal(ns, NsXml)) { //Check for xml namespace
                 XmlSchema schemaForXmlNS = Preprocessor.GetBuildInSchema();
                 XmlSchemaObject builtInAttributeGroup = schemaForXmlNS.AttributeGroups[qname];
                 if ((object)existingObject == (object)builtInAttributeGroup) {
                     table.Insert(qname, item);
                     return;
                 }
                 else if ((object)item == (object)builtInAttributeGroup) { //trying to overwrite customer's component with built-in, ignore built-in
                     return;
                 }
             }
             else if (IsValidAttributeGroupRedefine(existingObject, item, table)){ //check for redefines
                 return;
             }
             code = Res.Sch_DupAttributeGroup;
         } 
         else if (item is XmlSchemaAttribute) {
             string ns = nameTable.Add(qname.Namespace);
             if (Ref.Equal(ns, NsXml)) {
                 XmlSchema schemaForXmlNS = Preprocessor.GetBuildInSchema();
                 XmlSchemaObject builtInAttribute = schemaForXmlNS.Attributes[qname];
                 if ((object)existingObject == (object)builtInAttribute) { //replace built-in one
                     table.Insert(qname, item);
                     return;
                 }
                 else if ((object)item == (object)builtInAttribute) { //trying to overwrite customer's component with built-in, ignore built-in
                     return;
                 }
             }
             code = Res.Sch_DupGlobalAttribute;
         } 
         else if (item is XmlSchemaSimpleType) {
             if (IsValidTypeRedefine(existingObject, item, table)) {
                 return;
             }
             code = Res.Sch_DupSimpleType;
         } 
         else if (item is XmlSchemaComplexType) {
             if (IsValidTypeRedefine(existingObject, item, table)) {
                 return;
             }
             code = Res.Sch_DupComplexType;
         }
         else if (item is XmlSchemaGroup) {
             if (IsValidGroupRedefine(existingObject, item, table)){ //check for redefines
                 return;
             }
             code = Res.Sch_DupGroup;
         } 
         else if (item is XmlSchemaNotation) {
             code = Res.Sch_DupNotation;
         }
         else if (item is XmlSchemaIdentityConstraint) {
             code = Res.Sch_DupIdentityConstraint;
         }
         else {
             Debug.Assert(item is XmlSchemaElement);
         }
         SendValidationEvent(code, qname.ToString(), item);
     } 
     else {
         table.Add(qname, item);
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:77,代码来源:BaseProcessor.cs

示例5: AddToTable

 private bool AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
 {
     if (qname.Name.Length != 0)
     {
         XmlSchemaObject obj2 = table[qname];
         if (obj2 != null)
         {
             if ((obj2 == item) || (obj2.SourceUri == item.SourceUri))
             {
                 return true;
             }
             string res = string.Empty;
             if (item is XmlSchemaComplexType)
             {
                 res = "Sch_DupComplexType";
             }
             else if (item is XmlSchemaSimpleType)
             {
                 res = "Sch_DupSimpleType";
             }
             else if (item is XmlSchemaElement)
             {
                 res = "Sch_DupGlobalElement";
             }
             else if (item is XmlSchemaAttribute)
             {
                 if (qname.Namespace == "http://www.w3.org/XML/1998/namespace")
                 {
                     XmlSchemaObject obj3 = Preprocessor.GetBuildInSchema().Attributes[qname];
                     if (obj2 == obj3)
                     {
                         table.Insert(qname, item);
                         return true;
                     }
                     if (item == obj3)
                     {
                         return true;
                     }
                 }
                 res = "Sch_DupGlobalAttribute";
             }
             this.SendValidationEvent(new XmlSchemaException(res, qname.ToString()), XmlSeverityType.Error);
             return false;
         }
         table.Add(qname, item);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:48,代码来源:XmlSchemaSet.cs

示例6: ValidateUniqueTypeAttribution

		internal override void ValidateUniqueTypeAttribution (XmlSchemaObjectTable labels,
			ValidationEventHandler h, XmlSchema schema)
		{
			XmlSchemaElement labeled = labels [this.QualifiedName] as XmlSchemaElement;
			if (labeled == null)
				labels.Add (this.QualifiedName, this);
			else if (labeled.ElementType != this.ElementType)
				error (h, "Different types are specified on the same named elements in the same sequence. Element name is " + QualifiedName);
		}
开发者ID:nobled,项目名称:mono,代码行数:9,代码来源:XmlSchemaElement.cs

示例7: ValidateUniqueParticleAttribution

		internal override void ValidateUniqueParticleAttribution (XmlSchemaObjectTable qnames, ArrayList nsNames,
			ValidationEventHandler h, XmlSchema schema)
		{
			if (qnames.Contains (this.QualifiedName))// && !this.ParticleEquals ((XmlSchemaParticle) qnames [this.QualifiedName]))
				error (h, "Ambiguous element label was detected: " + this.QualifiedName);
			else {
				foreach (XmlSchemaAny any in nsNames) {
					if (any.ValidatedMaxOccurs == 0)
						continue;
					if (any.HasValueAny ||
						any.HasValueLocal && this.QualifiedName.Namespace == "" ||
						any.HasValueOther && this.QualifiedName.Namespace != this.QualifiedName.Namespace ||
						any.HasValueTargetNamespace && this.QualifiedName.Namespace == this.QualifiedName.Namespace) {
						error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);
						break;
					} else if (!any.HasValueOther) {
						bool bad = false;
						foreach (string ns in any.ResolvedNamespaces) {
							if (ns == this.QualifiedName.Namespace) {
								bad = true;
								break;
							}
						}
						if (bad) {
							error (h, "Ambiguous element label which is contained by -any- particle was detected: " + this.QualifiedName);
							break;
						}
					} else {
						if (any.TargetNamespace != this.QualifiedName.Namespace)
							error (h, String.Format ("Ambiguous element label '{0}' which is contained by -any- particle with ##other value than '{1}' was detected: ", this.QualifiedName.Namespace, any.TargetNamespace));
					}
				}
				qnames.Add (this.QualifiedName, this);
			}
		}
开发者ID:nobled,项目名称:mono,代码行数:35,代码来源:XmlSchemaElement.cs


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