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


C# Schema.XmlSchemaObjectCollection类代码示例

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


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

示例1: AddAttributes

 void AddAttributes(ClassInfo classInfo, XmlSchemaObjectCollection attributes)
 {
     foreach (XmlSchemaAttribute attribute in attributes)
     {
         classInfo.Attributes.Add(PropertyFromAttribute(classInfo, attribute));
     }
 }
开发者ID:i-e-b,项目名称:XsdToObject,代码行数:7,代码来源:ClassGenerator.cs

示例2: XmlSchemaRedefine

		public XmlSchemaRedefine()
		{
			attributeGroups = new XmlSchemaObjectTable();
			groups = new XmlSchemaObjectTable();
			items = new XmlSchemaObjectCollection(this);
			schemaTypes = new XmlSchemaObjectTable();
		}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:XmlSchemaRedefine.cs

示例3: WriteConstraintsSection

        public static void WriteConstraintsSection(this MamlWriter writer, Context context, XmlSchemaObjectCollection constraints)
        {
            if (!context.Configuration.DocumentConstraints)
                return;

            writer.StartSection("Constraints", "constraints");
            writer.WriteConstraintTable(context, constraints);
            writer.EndSection();
        }
开发者ID:sergey-steinvil,项目名称:xsddoc,代码行数:9,代码来源:SectionMamlWriterExtensions.cs

示例4: ReadDocumentationFromAnnotation

 void ReadDocumentationFromAnnotation(XmlSchemaObjectCollection annotationItems)
 {
     foreach (XmlSchemaObject schemaObject in annotationItems) {
         XmlSchemaDocumentation schemaDocumentation = schemaObject as XmlSchemaDocumentation;
         if (schemaDocumentation != null) {
             ReadSchemaDocumentationFromMarkup(schemaDocumentation.Markup);
         }
     }
     RemoveWhitespaceFromDocumentation();
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:10,代码来源:SchemaDocumentation.cs

示例5: XmlSchemaElement

		public XmlSchemaElement()
		{
			block = XmlSchemaDerivationMethod.None;
			final = XmlSchemaDerivationMethod.None;
			constraints = new XmlSchemaObjectCollection();
			refName = XmlQualifiedName.Empty;
			schemaTypeName = XmlQualifiedName.Empty;
			substitutionGroup = XmlQualifiedName.Empty;
			InitPostCompileInformations ();
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:XmlSchemaElement.cs

示例6: EnumerateDocumentedItems

 private static void EnumerateDocumentedItems(XmlSchemaObjectCollection schemaItems, Dictionary<string, string> documentedItems)
 {
     foreach (XmlSchemaObject schemaObj in schemaItems)
     {
         string documentation = GetDocumenation(schemaObj);
         if (documentation != null)
         {
             string uniqueName = GetUniqueName(schemaObj);
             documentedItems[uniqueName] = documentation;
         }
         EnumerateDocumentedItems(schemaObj, documentedItems);
     }
 }
开发者ID:anukat2015,项目名称:sones,代码行数:13,代码来源:WsdlUtils.cs

示例7: XmlSchema

		public XmlSchema ()
		{
			attributeFormDefault= XmlSchemaForm.None;
			blockDefault = XmlSchemaDerivationMethod.None;
			elementFormDefault = XmlSchemaForm.None;
			finalDefault = XmlSchemaDerivationMethod.None;
			includes = new XmlSchemaObjectCollection();
			isCompiled = false;
			items = new XmlSchemaObjectCollection();
			attributeGroups = new XmlSchemaObjectTable();
			attributes = new XmlSchemaObjectTable();
			elements = new XmlSchemaObjectTable();
			groups = new XmlSchemaObjectTable();
			notations = new XmlSchemaObjectTable();
			schemaTypes = new XmlSchemaObjectTable();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:16,代码来源:XmlSchema.cs

示例8: Process

 private static string Process(XmlSchemaObjectCollection collection)
 {
     StringBuilder result = new StringBuilder();
     foreach (XmlSchemaObject schemaObject in collection)
     {
         if (schemaObject is XmlSchemaDocumentation)
             result.Append(ProcessDocumentation((XmlSchemaDocumentation)schemaObject));
         else if (schemaObject is XmlSchemaElement)
             result.Append(ProcessElement((XmlSchemaElement)schemaObject));
         else if (schemaObject is XmlSchemaAnnotation)
             result.Append(ProcessAnnotation((XmlSchemaAnnotation)schemaObject));
         else if (schemaObject is XmlSchemaAttribute)
             result.Append(ProcessAttribute((XmlSchemaAttribute)schemaObject));
         else if (schemaObject is XmlSchemaSimpleType)
             result.Append(ProcessSchemaSimpleType((XmlSchemaSimpleType)schemaObject));
         else
             result.AppendLine(string.Format("Unsupported type: {0}", schemaObject));
     }
     return result.ToString();
 }
开发者ID:stephenwelsh,项目名称:msiext,代码行数:20,代码来源:Program.cs

示例9: WriteConstraintFieldList

        private static void WriteConstraintFieldList(this MamlWriter writer, XmlSchemaObjectCollection fields)
        {
            if (fields.Count == 1)
            {
                var field = (XmlSchemaXPath)fields[0];
                writer.WriteString(field.XPath);
                return;
            }

            writer.StartList(ListClass.Ordered);

            foreach (XmlSchemaXPath field in fields)
            {
                writer.StartListItem();
                writer.StartParagraph();
                writer.WriteString(field.XPath);
                writer.EndParagraph();
                writer.EndListItem();
            }

            writer.EndList();
        }
开发者ID:sergey-steinvil,项目名称:xsddoc,代码行数:22,代码来源:ConstraintsMamlWriterExtensions.cs

示例10: WriteConstraintTable

        public static void WriteConstraintTable(this MamlWriter writer, Context context, XmlSchemaObjectCollection constraints)
        {
            if (constraints.Count == 0)
                return;

            writer.StartTable();
            writer.StartTableHeader();
            writer.StartTableRow();

            writer.StartTableRowEntry();
            writer.EndTableRowEntry();

            writer.StartTableRowEntry();
            writer.WriteString("Type");
            writer.EndTableRowEntry();

            writer.StartTableRowEntry();
            writer.WriteString("Description");
            writer.EndTableRowEntry();

            writer.StartTableRowEntry();
            writer.WriteString("Selector");
            writer.EndTableRowEntry();

            writer.StartTableRowEntry();
            writer.WriteString("Fields");
            writer.EndTableRowEntry();

            writer.EndTableRow();
            writer.EndTableHeader();

            var rowBuilder = new ConstraintRowWriter(writer, context);
            rowBuilder.Traverse(constraints);

            writer.EndTable();
        }
开发者ID:sergey-steinvil,项目名称:xsddoc,代码行数:36,代码来源:ConstraintsMamlWriterExtensions.cs

示例11: SetItems

 internal override void SetItems(XmlSchemaObjectCollection newItems)
 {
     this.items = newItems;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:XmlSchemaAll.cs

示例12: ConstructRestriction

        //Compile-time Facet Checking
        internal virtual RestrictionFacets ConstructRestriction(DatatypeImplementation datatype, XmlSchemaObjectCollection facets, XmlNameTable nameTable) {
            //Datatype is the type on which this method is called
            RestrictionFacets derivedRestriction = new RestrictionFacets();
            FacetsCompiler facetCompiler = new FacetsCompiler(datatype, derivedRestriction);

            for (int i = 0; i < facets.Count; ++i) {
                XmlSchemaFacet facet = (XmlSchemaFacet)facets[i];
                if (facet.Value == null) {
                    throw new XmlSchemaException(Res.Sch_InvalidFacet, facet);
                }
                IXmlNamespaceResolver nsmgr = new SchemaNamespaceManager(facet);
                switch(facet.FacetType) {
                    case FacetType.Length:
                        facetCompiler.CompileLengthFacet(facet);
                    break;

                    case FacetType.MinLength:
                        facetCompiler.CompileMinLengthFacet(facet);
                    break;

                    case FacetType.MaxLength:
                        facetCompiler.CompileMaxLengthFacet(facet);
                    break;
    
                    case FacetType.Pattern:
                        facetCompiler.CompilePatternFacet(facet as XmlSchemaPatternFacet);
                    break;

                    case FacetType.Enumeration:
                        facetCompiler.CompileEnumerationFacet(facet, nsmgr, nameTable);                        
                    break;

                    case FacetType.Whitespace:
                        facetCompiler.CompileWhitespaceFacet(facet);
                    break;

                    case FacetType.MinInclusive:
                        facetCompiler.CompileMinInclusiveFacet(facet);
                    break;

                    case FacetType.MinExclusive:
                        facetCompiler.CompileMinExclusiveFacet(facet);
                    break;

                    case FacetType.MaxInclusive:
                        facetCompiler.CompileMaxInclusiveFacet(facet);
                    break;

                    case FacetType.MaxExclusive:
                        facetCompiler.CompileMaxExclusiveFacet(facet);
                    break;

                    case FacetType.TotalDigits:
                        facetCompiler.CompileTotalDigitsFacet(facet);
                    break;

                    case FacetType.FractionDigits:
                        facetCompiler.CompileFractionDigitsFacet(facet);
                    break;

                    default:
                        throw new XmlSchemaException(Res.Sch_UnknownFacet, facet);
                }
            }
            facetCompiler.FinishFacetCompile();
            facetCompiler.CompileFacetCombinations();
            return derivedRestriction;
        }
开发者ID:uQr,项目名称:referencesource,代码行数:69,代码来源:FacetChecker.cs

示例13: CountGroupSelfReference

 private int CountGroupSelfReference(XmlSchemaObjectCollection items, XmlQualifiedName name, XmlSchemaGroup redefined)
 {
     int num = 0;
     for (int i = 0; i < items.Count; i++)
     {
         XmlSchemaGroupRef source = items[i] as XmlSchemaGroupRef;
         if (source != null)
         {
             if (source.RefName == name)
             {
                 source.Redefined = redefined;
                 if ((source.MinOccurs != 1M) || (source.MaxOccurs != 1M))
                 {
                     base.SendValidationEvent("Sch_MinMaxGroupRedefine", source);
                 }
                 num++;
             }
         }
         else if (items[i] is XmlSchemaGroupBase)
         {
             num += this.CountGroupSelfReference(((XmlSchemaGroupBase) items[i]).Items, name, redefined);
         }
         if (num > 1)
         {
             return num;
         }
     }
     return num;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:Preprocessor.cs

示例14: AddAttribute

            private XmlSchemaAttribute AddAttribute(string localName, string prefix, string childURI, string attrValue, bool bCreatingNewType, XmlSchema parentSchema, XmlSchemaObjectCollection addLocation, XmlSchemaObjectTable compiledAttributes)
            {
                if (childURI == XmlSchema.Namespace)
                {
                    throw new XmlSchemaInferenceException(Res.SchInf_schema, 0, 0);
                }

                XmlSchemaAttribute xsa = null;
                int AttributeType = -1;
                XmlSchemaAttribute returnedAttribute = null;    //this value will change to attributeReference if childURI!= parentURI
                XmlSchema xs = null;
                bool add = true;

                Debug.Assert(compiledAttributes != null); //AttributeUses is never null
                // First we need to look into the already compiled attributes 
                //   (they come from the schemaset which we got on input)
                // If there are none or we don't find it there, then we must search the list of attributes
                //   where we are going to add a new one (if it doesn't exist). 
                //   This is necessary to avoid adding duplicate attribute declarations.
                ICollection searchCollectionPrimary, searchCollectionSecondary;
                if (compiledAttributes.Count > 0) {
                    searchCollectionPrimary = compiledAttributes.Values;
                    searchCollectionSecondary = addLocation;
                }
                else {
                    searchCollectionPrimary = addLocation;
                    searchCollectionSecondary = null;
                }
                if (childURI == XmlReservedNs.NsXml)
                {
                    XmlSchemaAttribute attributeReference = null;
                    //see if the reference exists
                    attributeReference = FindAttributeRef(searchCollectionPrimary, localName, childURI);
                    if (attributeReference == null && searchCollectionSecondary != null) {
                        attributeReference = FindAttributeRef(searchCollectionSecondary, localName, childURI);
                    }
                    if (attributeReference == null)
                    {
                        attributeReference = new XmlSchemaAttribute();
                        attributeReference.RefName = new XmlQualifiedName(localName, childURI);
                        if (bCreatingNewType && this.Occurrence == InferenceOption.Restricted)
                        {
                            attributeReference.Use = XmlSchemaUse.Required;
                        }
                        else
                        {
                            attributeReference.Use = XmlSchemaUse.Optional;
                        }

                        addLocation.Add(attributeReference);
                    }
                    returnedAttribute = attributeReference;
                }
                else
                {
                    if (childURI.Length == 0)
                    {
                        xs = parentSchema;
                        add = false;
                    }
                    else if (childURI != null && !schemaSet.Contains(childURI))
                    {
                        /*if (parentSchema.AttributeFormDefault = XmlSchemaForm.Unqualified && childURI.Length == 0)
                    {
                        xs = parentSchema;
                        add = false;
                        break;
                    }*/
                        xs = new XmlSchema();
                        xs.AttributeFormDefault = XmlSchemaForm.Unqualified;
                        xs.ElementFormDefault = XmlSchemaForm.Qualified;
                        if (childURI.Length != 0)
                            xs.TargetNamespace = childURI;
                        //schemas.Add(childURI, xs);
                        this.schemaSet.Add(xs);
                        if (prefix.Length != 0 && String.Compare(prefix, "xml", StringComparison.OrdinalIgnoreCase) != 0)
                            NamespaceManager.AddNamespace(prefix, childURI);
                    }
                    else
                    {
                        ArrayList col = this.schemaSet.Schemas(childURI) as ArrayList;
                        if (col != null && col.Count > 0)
                        {
                            xs = col[0] as XmlSchema;
                        }

                    }
                    if (childURI.Length != 0) //
                    {
                        XmlSchemaAttribute attributeReference = null;
                        //see if the reference exists
                        attributeReference = FindAttributeRef(searchCollectionPrimary, localName, childURI);
                        if (attributeReference == null & searchCollectionSecondary != null) {
                            attributeReference = FindAttributeRef(searchCollectionSecondary, localName, childURI);
                        }
                        if (attributeReference == null)
                        {
                            attributeReference = new XmlSchemaAttribute();
                            attributeReference.RefName = new XmlQualifiedName(localName, childURI);
                            if (bCreatingNewType && this.Occurrence == InferenceOption.Restricted)
//.........这里部分代码省略.........
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:101,代码来源:infer.cs

示例15: MakeExistingAttributesOptional

 internal void MakeExistingAttributesOptional(XmlSchemaComplexType ct, XmlSchemaObjectCollection attributesInInstance) {
     if (ct == null)  {
         throw new XmlSchemaInferenceException(Res.SchInf_noct, 0, 0);
     }
     if (ct.ContentModel != null) {
         XmlSchemaSimpleContentExtension xssce = CheckSimpleContentExtension(ct);
         SwitchUseToOptional(xssce.Attributes, attributesInInstance);
     }
     else { //either <xs:attribute> as child of xs:complexType or the attributes are within the content model
         SwitchUseToOptional(ct.Attributes, attributesInInstance);
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:12,代码来源:infer.cs


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