當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlSchemaAnyAttribute.BuildNamespaceList方法代碼示例

本文整理匯總了C#中System.Xml.Schema.XmlSchemaAnyAttribute.BuildNamespaceList方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlSchemaAnyAttribute.BuildNamespaceList方法的具體用法?C# XmlSchemaAnyAttribute.BuildNamespaceList怎麽用?C# XmlSchemaAnyAttribute.BuildNamespaceList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.Schema.XmlSchemaAnyAttribute的用法示例。


在下文中一共展示了XmlSchemaAnyAttribute.BuildNamespaceList方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: XmlSchemaComplexType

 static XmlSchemaComplexType() {
     anyType = new XmlSchemaComplexType();
     anyType.SetContentType(XmlSchemaContentType.Mixed);
     anyType.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
     XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();
     anyAttribute.BuildNamespaceList(null);
     anyType.SetAttributeWildcard(anyAttribute);
     anyType.ElementDecl.AnyAttribute = anyAttribute;
 }
開發者ID:ArildF,項目名稱:masters,代碼行數:9,代碼來源:xmlschemacomplextype.cs

示例2: PreprocessAttributes

 private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent)
 {
     for (int i = 0; i < attributes.Count; i++)
     {
         this.SetParent(attributes[i], parent);
         XmlSchemaAttribute attribute = attributes[i] as XmlSchemaAttribute;
         if (attribute != null)
         {
             this.PreprocessLocalAttribute(attribute);
         }
         else
         {
             XmlSchemaAttributeGroupRef source = (XmlSchemaAttributeGroupRef) attributes[i];
             if (source.RefName.IsEmpty)
             {
                 base.SendValidationEvent("Sch_MissAttribute", "ref", source);
             }
             else
             {
                 this.ValidateQNameAttribute(source, "ref", source.RefName);
             }
             this.PreprocessAnnotation(attributes[i]);
             this.ValidateIdAttribute(attributes[i]);
         }
     }
     if (anyAttribute != null)
     {
         try
         {
             this.SetParent(anyAttribute, parent);
             this.PreprocessAnnotation(anyAttribute);
             anyAttribute.BuildNamespaceList(this.targetNamespace);
         }
         catch (FormatException exception)
         {
             base.SendValidationEvent("Sch_InvalidAnyDetailed", new string[] { exception.Message }, exception, anyAttribute);
         }
         this.ValidateIdAttribute(anyAttribute);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:40,代碼來源:Preprocessor.cs

示例3: PreprocessAttributes

 private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent) {
     for (int i = 0; i < attributes.Count; ++i) {
         SetParent(attributes[i], parent);
         XmlSchemaAttribute attr = attributes[i] as XmlSchemaAttribute;
         if (attr != null) {
             PreprocessLocalAttribute(attr);
         } 
         else { // XmlSchemaAttributeGroupRef
             XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)attributes[i];
             if (attributeGroupRef.RefName.IsEmpty) {
                 SendValidationEvent(Res.Sch_MissAttribute, "ref", attributeGroupRef);
             }
             else {
                 ValidateQNameAttribute(attributeGroupRef, "ref", attributeGroupRef.RefName);
             }
             PreprocessAnnotation(attributes[i]); //set parent of annotation child of attributeGroupRef
             ValidateIdAttribute(attributes[i]);
         }
     }
     if (anyAttribute != null) {
         try {
             SetParent(anyAttribute, parent);
             PreprocessAnnotation(anyAttribute); //set parent of annotation child of any attribute
             anyAttribute.BuildNamespaceList(this.targetNamespace);
         } 
         catch(FormatException fe) {
             SendValidationEvent(Res.Sch_InvalidAnyDetailed, new string[] {fe.Message}, fe, anyAttribute);
         }
         ValidateIdAttribute(anyAttribute);
     }
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:31,代碼來源:Preprocessor.cs

示例4: CreateAnyType

        static XmlSchemaComplexType CreateAnyType(XmlSchemaContentProcessing processContents) {
            XmlSchemaComplexType localAnyType = new XmlSchemaComplexType();
            localAnyType.SetQualifiedName(DatatypeImplementation.QnAnyType);

            XmlSchemaAny anyElement = new XmlSchemaAny();
            anyElement.MinOccurs = decimal.Zero;
            anyElement.MaxOccurs = decimal.MaxValue;

            anyElement.ProcessContents = processContents;
            anyElement.BuildNamespaceList(null);
            XmlSchemaSequence seq = new XmlSchemaSequence();
            seq.Items.Add(anyElement);

            localAnyType.SetContentTypeParticle(seq);
            localAnyType.SetContentType(XmlSchemaContentType.Mixed);

            localAnyType.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
            localAnyType.ElementDecl.SchemaType = localAnyType;

            //Create contentValidator for Any
            ParticleContentValidator contentValidator = new ParticleContentValidator(XmlSchemaContentType.Mixed);
            contentValidator.Start();
            contentValidator.OpenGroup();
            contentValidator.AddNamespaceList(anyElement.NamespaceList, anyElement);
            contentValidator.AddStar();
            contentValidator.CloseGroup();
            ContentValidator anyContentValidator = contentValidator.Finish(true);
            localAnyType.ElementDecl.ContentValidator = anyContentValidator;

            XmlSchemaAnyAttribute anyAttribute = new XmlSchemaAnyAttribute();
            anyAttribute.ProcessContents = processContents;
            anyAttribute.BuildNamespaceList(null);
            localAnyType.SetAttributeWildcard(anyAttribute);
            localAnyType.ElementDecl.AnyAttribute = anyAttribute;
            return localAnyType;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:36,代碼來源:XmlSchemaComplexType.cs

示例5: PreprocessAttributes

 private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute) {
     foreach (XmlSchemaAnnotated obj in attributes) {
         if (obj is XmlSchemaAttribute) {
             PreprocessLocalAttribute((XmlSchemaAttribute)obj);
         } 
         else { // XmlSchemaAttributeGroupRef
             XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)obj;
             if (attributeGroupRef.RefName.IsEmpty) {
                 SendValidationEvent(Res.Sch_MissAttribute, "ref", attributeGroupRef);
             }
             else {
                 ValidateQNameAttribute(attributeGroupRef, "ref", attributeGroupRef.RefName);
             }
             ValidateIdAttribute(obj);
         }
     }
     if (anyAttribute != null) {
         try {
             anyAttribute.BuildNamespaceList(this.targetNamespace);
         } 
         catch {
             SendValidationEvent(Res.Sch_InvalidAnyAttribute, anyAttribute);
         }
         ValidateIdAttribute(anyAttribute);
     }
 }
開發者ID:ArildF,項目名稱:masters,代碼行數:26,代碼來源:compiler.cs

示例6: CreateAnyType

 private static XmlSchemaComplexType CreateAnyType(XmlSchemaContentProcessing processContents)
 {
     XmlSchemaComplexType type = new XmlSchemaComplexType();
     type.SetQualifiedName(DatatypeImplementation.QnAnyType);
     XmlSchemaAny item = new XmlSchemaAny {
         MinOccurs = 0M,
         MaxOccurs = 79228162514264337593543950335M,
         ProcessContents = processContents
     };
     item.BuildNamespaceList(null);
     XmlSchemaSequence sequence = new XmlSchemaSequence();
     sequence.Items.Add(item);
     type.SetContentTypeParticle(sequence);
     type.SetContentType(XmlSchemaContentType.Mixed);
     type.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
     type.ElementDecl.SchemaType = type;
     ParticleContentValidator validator = new ParticleContentValidator(XmlSchemaContentType.Mixed);
     validator.Start();
     validator.OpenGroup();
     validator.AddNamespaceList(item.NamespaceList, item);
     validator.AddStar();
     validator.CloseGroup();
     ContentValidator validator2 = validator.Finish(true);
     type.ElementDecl.ContentValidator = validator2;
     XmlSchemaAnyAttribute attribute = new XmlSchemaAnyAttribute {
         ProcessContents = processContents
     };
     attribute.BuildNamespaceList(null);
     type.SetAttributeWildcard(attribute);
     type.ElementDecl.AnyAttribute = attribute;
     return type;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:32,代碼來源:XmlSchemaComplexType.cs


注:本文中的System.Xml.Schema.XmlSchemaAnyAttribute.BuildNamespaceList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。