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

C# Schema.XmlSchemaObjectCollection类代码示例

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

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



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


示例16: ProcessAttributes

            internal void ProcessAttributes(ref XmlSchemaElement xse, XmlSchemaType effectiveSchemaType, bool bCreatingNewType, XmlSchema parentSchema)
            {
                XmlSchemaObjectCollection attributesSeen = new XmlSchemaObjectCollection();
                XmlSchemaComplexType ct = effectiveSchemaType as XmlSchemaComplexType;
                
                Debug.Assert(xtr.NodeType == XmlNodeType.Attribute);
                do
                {
                    if (xtr.NamespaceURI == XmlSchema.Namespace)
                    {
                        throw new XmlSchemaInferenceException(Res.SchInf_schema, 0, 0);
                    }

                    if (xtr.NamespaceURI == XmlReservedNs.NsXmlNs)
                    {
                        if (xtr.Prefix=="xmlns") 
                            NamespaceManager.AddNamespace(xtr.LocalName, xtr.Value);
                    }
                    else if (xtr.NamespaceURI == XmlReservedNs.NsXsi)
                    {
                        string localName = xtr.LocalName;
                        if (localName == "nil") 
                        {
                            xse.IsNillable = true;
                        }
                        else if (localName != "type" && localName != "schemaLocation" && localName != "noNamespaceSchemaLocation")
                        {
                            throw new XmlSchemaInferenceException(Res.Sch_NotXsiAttribute,localName);
                        }
                    }
                    else
                    {
                        if (ct == null || ct == XmlSchemaComplexType.AnyType)
                        {
                            ct = new XmlSchemaComplexType();
                            xse.SchemaType = ct;
                        }

                        XmlSchemaAttribute xsa=null;
                        //The earlier assumption of checking just schemaTypeName !Empty is not correct for schemas that are not generated by us, schemaTypeName can point to any complex type as well
                        //Check that it is a simple type by checking typeCode
                        //Switch to complex type simple content extension
                        if (effectiveSchemaType != null && effectiveSchemaType.Datatype != null && !xse.SchemaTypeName.IsEmpty)  
                        {
                            //type was previously simple type, now it will become complex with simple type extension
                            Debug.Assert(ct != null);
                            XmlSchemaSimpleContent sc = new XmlSchemaSimpleContent();
                            ct.ContentModel = sc;
                            XmlSchemaSimpleContentExtension sce = new XmlSchemaSimpleContentExtension();
                            sc.Content = sce;
                            sce.BaseTypeName = xse.SchemaTypeName;
                            sce.LineNumber = xse.LineNumber;
                            xse.LineNumber = 0;
                            xse.SchemaTypeName = XmlQualifiedName.Empty; //re-set the name
                        }
                        
                        Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type
                        if (ct.ContentModel != null) 
                        {
                            XmlSchemaSimpleContentExtension sce = CheckSimpleContentExtension(ct);
                            Debug.Assert(sce != null);
                            xsa = AddAttribute(xtr.LocalName, xtr.Prefix, xtr.NamespaceURI, xtr.Value, bCreatingNewType, parentSchema, sce.Attributes, ct.AttributeUses);
                        } 
                        else //add atributes directly to complex type
                        {
                            xsa = AddAttribute(xtr.LocalName, xtr.Prefix, xtr.NamespaceURI, xtr.Value, bCreatingNewType, parentSchema, ct.Attributes, ct.AttributeUses);
                        }
                        if (xsa != null) {
                            attributesSeen.Add(xsa);
                        }
                    }
                    
                } while (xtr.MoveToNextAttribute());
                if (!bCreatingNewType)
                {   
                    //make attributes that did not appear this time optional
                    if (ct!=null) {
                        MakeExistingAttributesOptional(ct, attributesSeen);
                    }
                }
            }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:81,代码来源:infer.cs


示例17: Add

 private void Add(XmlSchemaObjectCollection collToAdd) {
     this.InnerList.InsertRange(0, collToAdd);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:3,代码来源:XmlSchemaObjectCollection.cs


示例18: SetAttributes

 internal void SetAttributes(XmlSchemaObjectCollection newAttributes) {
     attributes = newAttributes;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:3,代码来源:XmlSchemaComplexContentRestriction.cs


示例19: Clone

 internal XmlSchemaObjectCollection Clone() {
     XmlSchemaObjectCollection coll = new XmlSchemaObjectCollection();
     coll.Add(this);
     return coll;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:5,代码来源:XmlSchemaObjectCollection.cs


示例20: NameOf

 internal static XmlQualifiedName NameOf(XmlSchemaObjectCollection items) {
     ArrayList list = new ArrayList();
     
     for (int i = 0; i < items.Count; i++) {
         list.Add(NameOf(items[i]));
     }
     list.Sort(new QNameComparer());
     return (XmlQualifiedName)list[0];
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:9,代码来源:SchemaObjectWriter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Schema.XmlSchemaObjectTable类代码示例发布时间:2022-05-26
下一篇:
C# Schema.XmlSchemaObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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