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

C# Schema.XmlSchemaComplexType类代码示例

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

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



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

示例1: GetSchema

        public XmlSchemaElement GetSchema()
        {
            var type = new XmlSchemaComplexType();

            type.Attributes.Add(new XmlSchemaAttribute
                                    {
                                        Name = "refValue",
                                        Use = XmlSchemaUse.Required,
                                        SchemaTypeName =
                                            new XmlQualifiedName("positiveInteger", "http://www.w3.org/2001/XMLSchema")
                                    });

            type.Attributes.Add(new XmlSchemaAttribute
                                    {
                                        Name = "test",
                                        Use = XmlSchemaUse.Optional,
                                        SchemaTypeName =
                                            new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
                                    });

            
            var restriction = new XmlSchemaSimpleTypeRestriction
                                  {
                                      BaseTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
                                  };

            restriction.Facets.Add(new XmlSchemaEnumerationFacet {Value = "years"});
            restriction.Facets.Add(new XmlSchemaEnumerationFacet {Value = "weeks"});
            restriction.Facets.Add(new XmlSchemaEnumerationFacet {Value = "days"});

            var simpleType = new XmlSchemaSimpleType {Content = restriction};


            type.Attributes.Add(new XmlSchemaAttribute
                                    {
                                        Name = "units",
                                        Use = XmlSchemaUse.Required,
                                        SchemaType = simpleType
                                    });


            type.Attributes.Add(new XmlSchemaAttribute
                                    {
                                        Name = "expressionLanguage",
                                        Use = XmlSchemaUse.Optional,
                                        SchemaTypeName =
                                            new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema")
                                    });

            var element = new XmlSchemaElement
                              {
                                  Name = "dicom-age-less-than",
                                  SchemaType = type
                              };

            return element;
        }
开发者ID:nhannd,项目名称:Xian,代码行数:57,代码来源:DicomAgeLessThanSpecification.cs


示例2: AndSchema

		public static XmlSchemaElement AndSchema()
		{
			var type = new XmlSchemaComplexType();

			var any = new XmlSchemaAny();
			any.MinOccurs = 1;
			any.MaxOccursString = "unbounded";
			any.ProcessContents = XmlSchemaContentProcessing.Strict;
			any.Namespace = "##local";

			var sequence = new XmlSchemaSequence();
			type.Particle = sequence;
			sequence.Items.Add(any);

			var attrib = new XmlSchemaAttribute();
			attrib.Name = "expressionLanguage";
			attrib.Use = XmlSchemaUse.Optional;
			attrib.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
			type.Attributes.Add(attrib);

			attrib = new XmlSchemaAttribute();
			attrib.Name = "failMessage";
			attrib.Use = XmlSchemaUse.Optional;
			attrib.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
			type.Attributes.Add(attrib);

			var element = new XmlSchemaElement();
			element.Name = "and";
			element.SchemaType = type;

			return element;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:32,代码来源:XmlSpecificationSchema.cs


示例3: CreateProtoComplexType

        XObject[] CreateProtoComplexType(XmlSchemaComplexType complexType) {
            if (complexType.ContentModel != null) {
                if ((complexType.ContentModel as XmlSchemaSimpleContent) != null) {
                    return CreateProtoSimpleContent((complexType.ContentModel as XmlSchemaSimpleContent), complexType.BaseXmlSchemaType).ToArray();
                } else if ((complexType.ContentModel as XmlSchemaComplexContent) != null) {
                    return CreateProtoComplexContent((complexType.ContentModel as XmlSchemaComplexContent), complexType.BaseXmlSchemaType).ToArray();
                } else {
                    throw new Exception("not implemented");
                }
            } else {
                var complexContentExt = new XmlSchemaComplexContentExtension();
                if (complexType.BaseXmlSchemaType != null) {
                    complexContentExt.BaseTypeName = complexType.BaseXmlSchemaType.QualifiedName;
                } else {
                    complexContentExt.BaseTypeName = null;
                }

                if (complexType.Attributes != null) {
                    foreach (var i in complexType.Attributes) {
                        complexContentExt.Attributes.Add(i);
                    }
                }
                complexContentExt.Particle = complexType.Particle;
                var complexContent = new XmlSchemaComplexContent();
                complexContent.Content = complexContentExt;
                return CreateProtoComplexContent(complexContent, complexType.BaseXmlSchemaType).ToArray();
            }
        }
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:28,代码来源:XmlParser.cs


示例4: ChildComplexType

 public ChildComplexType(XmlSchemaComplexType complexType, string elementName, string dotnetClassName, string nameSpace, XmlQualifiedName qname)
 {
     this.ComplexType = complexType;
     this.ElementName = elementName;
     this.DotnetClassName = dotnetClassName;
     this.Namespace = nameSpace;
     this.Qname = qname;
 }
开发者ID:MartinBG,项目名称:Gva,代码行数:8,代码来源:ChildComplexType.cs


示例5: 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


示例6: CreateXmlSchemaForIndicatorsInGroup

        /// <summary>
        /// Формируем XmlSchema для правильного отображения индикаторов группы в VGridControl
        /// </summary>
        /// <param name="elmList">названия всех по</param>
        /// <returns>Возвращаем поток в который записана XmlSchema</returns>
        public static MemoryStream CreateXmlSchemaForIndicatorsInGroup(List<string[]> elmList)
        {
            var xmlSchema = new XmlSchema();

            // <xs:element name="root">
            var elementRoot = new XmlSchemaElement();
            xmlSchema.Items.Add(elementRoot);
            elementRoot.Name = "root";
            // <xs:complexType>
            var complexType = new XmlSchemaComplexType();
            elementRoot.SchemaType = complexType;

            // <xs:choice minOccurs="0" maxOccurs="unbounded">
            var choice = new XmlSchemaChoice();
            complexType.Particle = choice;
            choice.MinOccurs = 0;
            choice.MaxOccursString = "unbounded";

            // <xs:element name="record">
            var elementRecord = new XmlSchemaElement();
            choice.Items.Add(elementRecord);
            elementRecord.Name = "record";
            // <xs:complexType>
            var complexType2 = new XmlSchemaComplexType();
            elementRecord.SchemaType = complexType2;

            // <xs:sequence>
            var sequence = new XmlSchemaSequence();
            complexType2.Particle = sequence;

            foreach (var el in elmList)
            {
                var element = new XmlSchemaElement();
                sequence.Items.Add(element);
                element.Name = el[0];
                element.SchemaTypeName = new XmlQualifiedName(el[1], "http://www.w3.org/2001/XMLSchema");
            }

            var schemaSet = new XmlSchemaSet();
            schemaSet.Add(xmlSchema);
            schemaSet.Compile();

            XmlSchema compiledSchema = null;

            foreach (XmlSchema schema1 in schemaSet.Schemas())
                compiledSchema = schema1;

            var nsmgr = new XmlNamespaceManager(new NameTable());
            nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");

            var ms = new MemoryStream();
            if (compiledSchema != null) compiledSchema.Write(ms, nsmgr);
            ms.Position = 0;

            return ms;
        }
开发者ID:Biskup,项目名称:GOATApplication,代码行数:61,代码来源:StaticData.cs


示例7: GetSchema

		public XmlSchemaElement GetSchema()
		{
			var type = new XmlSchemaComplexType();

			return new XmlSchemaElement
			{
				Name = OperatorTag,
				SchemaType = type
			};
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:10,代码来源:RequiresOrderIntendedForQCSpecification.cs


示例8: GetStype

		XmlSchemaComplexType GetStype ()
		{
			XmlSchemaSequence seq = new XmlSchemaSequence ();
			seq.Items.Add (new XmlSchemaAny ());
		
			XmlSchemaComplexType stype = new XmlSchemaComplexType ();
			stype.Particle = seq;
			
			return stype;
		}
开发者ID:nobled,项目名称:mono,代码行数:10,代码来源:XmlSchemasTests.cs


示例9: CheckComplexType

 private void CheckComplexType(XmlQualifiedName typeName, XmlSchemaComplexType type)
 {
     if (type.IsAbstract)
     {
         ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, System.Runtime.Serialization.SR.GetString("AbstractTypeNotSupported"));
     }
     if (type.IsMixed)
     {
         ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, System.Runtime.Serialization.SR.GetString("MixedContentNotSupported"));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:SchemaImporter.cs


示例10: VisitComplexType

        public virtual void VisitComplexType(XmlSchemaComplexType xmlSchemaComplexType)
        {
            //            XmlSchemaParticle particle = xmlSchemaComplexType.ContentTypeParticle;
            //            VisitParticle(particle);

            foreach (XmlSchemaObject attribute in xmlSchemaComplexType.Attributes)
            {
                Dispatch(attribute);
            }
            Dispatch(xmlSchemaComplexType.Particle);
        }
开发者ID:willrawls,项目名称:arp,代码行数:11,代码来源:XsdVisitor.cs


示例11: Generator

 public Generator(XmlSchemaComplexType xsCoxType,
                  Dictionary<string, string> elementRef,
                  Dictionary<string, string> includePath,
                  List<KeyValuePair<string, string>> elementSubstitutionRef,
                  Dictionary<string, XmlSchemaGroup> elementGroupRef)
 {
     this.includePath = includePath;
     this.elementRef = elementRef;
     this.elementSubstitutionRef = elementSubstitutionRef;
     this.elementGroupRef = elementGroupRef;
     this.setXsd(xsCoxType);
 }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:12,代码来源:Generator.cs


示例12: FixtureInit

        public override void FixtureInit()
        {
            XmlSchemaCompletionCollection schemas = new XmlSchemaCompletionCollection();
            schemas.Add(SchemaCompletion);
            XmlSchemaCompletion xsdSchemaCompletion = new XmlSchemaCompletion(ResourceManager.ReadXsdSchema());
            schemas.Add(xsdSchemaCompletion);

            string xml = GetSchema();
            int index = xml.IndexOf("type=\"text-type\"");
            index = xml.IndexOf("text-type", index);
            XmlSchemaDefinition schemaDefinition = new XmlSchemaDefinition(schemas, SchemaCompletion);
            schemaComplexType = (XmlSchemaComplexType)schemaDefinition.GetSelectedSchemaObject(xml, index);
        }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:13,代码来源:ElementTypeSelectedTestFixture.cs


示例13: FixtureInit

		public override void FixtureInit()
		{
			XmlSchemaCompletionDataCollection schemas = new XmlSchemaCompletionDataCollection();
			schemas.Add(SchemaCompletionData);
			XmlSchemaCompletionData xsdSchemaCompletionData = new XmlSchemaCompletionData(ResourceManager.GetXsdSchema());
			schemas.Add(xsdSchemaCompletionData);
			XmlCompletionDataProvider provider = new XmlCompletionDataProvider(schemas, xsdSchemaCompletionData, String.Empty);
			
			string xml = GetSchema();
			int index = xml.IndexOf("type=\"text-type\"");
			index = xml.IndexOf("text-type", index);
			schemaComplexType = (XmlSchemaComplexType)XmlView.GetSchemaObjectSelected(xml, index, provider, SchemaCompletionData);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:13,代码来源:ElementTypeSelectedTestFixture.cs


示例14: AddExtensionAttributes

        private void AddExtensionAttributes(ClassInfo classInfo, XmlSchemaComplexType complex)
        {
            if (complex.ContentModel == null || !(complex.ContentModel.Content is XmlSchemaSimpleContentExtension))
                return;

            var sce = complex.ContentModel.Content as XmlSchemaSimpleContentExtension;

            if (sce.Attributes.Count == 0)
                return;

            AddAttributes(classInfo, sce.Attributes);
            AddValueProperty(classInfo, sce);
        }
开发者ID:7digital,项目名称:XsdToObject,代码行数:13,代码来源:ClassParser.cs


示例15: Visit

        protected override void Visit(XmlSchemaComplexType type)
        {
            if (type.QualifiedName.IsEmpty)
                base.Visit(type);
            else
            {
                if (!AddUsage(type))
                    return;

                PushNamedObject(type);
                base.Visit(type);
                PopNamedObject();
            }
        }
开发者ID:sergey-steinvil,项目名称:xsddoc,代码行数:14,代码来源:TypeUsageFinder.cs


示例16: setXsd

        private void setXsd(XmlSchemaComplexType xsCoxType) 
        {
            
            m_ClassGen.CName = xsCoxType.Name;

            if (xsCoxType.ContentModel == null)
            {
                if (xsCoxType.Particle is XmlSchemaGroupRef)
                {
                    // 만듬.
                }

                else if (xsCoxType.Particle is XmlSchemaGroupBase)
                {
                    XmlSchemaGroupBase xgb = xsCoxType.Particle as XmlSchemaGroupBase;
                    roopItem(xgb);
                }
            }

            else if (xsCoxType.ContentModel is XmlSchemaComplexContent)
            {
                XmlSchemaComplexContent xscc = xsCoxType.ContentModel as XmlSchemaComplexContent;

                if (xscc.Content is XmlSchemaComplexContentExtension)
                {
                    XmlSchemaComplexContentExtension xscc_Extension = xscc.Content as XmlSchemaComplexContentExtension;
                    m_ClassGen.BaseName = xscc_Extension.BaseTypeName.Name;

                    // 위에 (**) 코드랑 같이 가려고 했는데 XmlSchemaComplexType 하고 같은 인터페이스를 사용하지 않음. 아옭 헷갈리
                    if (xscc_Extension.Particle is XmlSchemaGroupRef)
                    {
                        // 만듬.
                    }

                    else if (xscc_Extension.Particle is XmlSchemaGroupBase)
                    {
                        XmlSchemaGroupBase xgb = xscc_Extension.Particle as XmlSchemaGroupBase;
                        roopItem(xgb);
                    }

                }
                else if (xscc.Content is XmlSchemaComplexContentRestriction)
                {
                    throw new NotImplementedException();
                }
                
            }
            
        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:49,代码来源:Generator.cs


示例17: AddElementAndType

 private static void AddElementAndType(XmlSchema schema, string baseXsdType, string ns)
 {
     XmlSchemaElement item = new XmlSchemaElement();
     item.Name = baseXsdType;
     item.SchemaTypeName = new XmlQualifiedName(baseXsdType, ns);
     schema.Items.Add(item);
     XmlSchemaComplexType type = new XmlSchemaComplexType();
     type.Name = baseXsdType;
     XmlSchemaSimpleContent content = new XmlSchemaSimpleContent();
     type.ContentModel = content;
     XmlSchemaSimpleContentExtension extension = new XmlSchemaSimpleContentExtension();
     extension.BaseTypeName = new XmlQualifiedName(baseXsdType, "http://www.w3.org/2001/XMLSchema");
     content.Content = extension;
     schema.Items.Add(type);
 }
开发者ID:hdougie,项目名称:webservicestudio2,代码行数:15,代码来源:Wsdl.cs


示例18: AddDefaultDatasetType

 private static void AddDefaultDatasetType(XmlSchemaSet schemas, string localName, string ns)
 {
     XmlSchemaComplexType item = new XmlSchemaComplexType {
         Name = localName,
         Particle = new XmlSchemaSequence()
     };
     XmlSchemaElement element = new XmlSchemaElement {
         RefName = new XmlQualifiedName("schema", "http://www.w3.org/2001/XMLSchema")
     };
     ((XmlSchemaSequence) item.Particle).Items.Add(element);
     XmlSchemaAny any = new XmlSchemaAny();
     ((XmlSchemaSequence) item.Particle).Items.Add(any);
     XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);
     schema.Items.Add(item);
     schemas.Reprocess(schema);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:SchemaExporter.cs


示例19: AddDefaultTypedDatasetType

 private static void AddDefaultTypedDatasetType(XmlSchemaSet schemas, XmlSchema datasetSchema, string localName, string ns)
 {
     XmlSchemaComplexType item = new XmlSchemaComplexType {
         Name = localName,
         Particle = new XmlSchemaSequence()
     };
     XmlSchemaAny any = new XmlSchemaAny {
         Namespace = (datasetSchema.TargetNamespace == null) ? string.Empty : datasetSchema.TargetNamespace
     };
     ((XmlSchemaSequence) item.Particle).Items.Add(any);
     schemas.Add(datasetSchema);
     XmlSchema schema = SchemaHelper.GetSchema(ns, schemas);
     schema.Items.Add(item);
     schemas.Reprocess(datasetSchema);
     schemas.Reprocess(schema);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:SchemaExporter.cs


示例20: XmlSchemaComplexType

        //const byte dupDeclMask = 0x08;

        static XmlSchemaComplexType() {
            anyTypeLax = CreateAnyType(XmlSchemaContentProcessing.Lax);
            anyTypeSkip = CreateAnyType(XmlSchemaContentProcessing.Skip);

            // Create xdt:untypedAny
            untypedAnyType = new XmlSchemaComplexType();
            untypedAnyType.SetQualifiedName(new XmlQualifiedName("untypedAny", XmlReservedNs.NsXQueryDataType));
            untypedAnyType.IsMixed = true;
            untypedAnyType.SetContentTypeParticle(anyTypeLax.ContentTypeParticle);
            untypedAnyType.SetContentType(XmlSchemaContentType.Mixed);

            untypedAnyType.ElementDecl = SchemaElementDecl.CreateAnyTypeElementDecl();
            untypedAnyType.ElementDecl.SchemaType = untypedAnyType;
            untypedAnyType.ElementDecl.ContentValidator = AnyTypeContentValidator;

        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:18,代码来源:XmlSchemaComplexType.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Schema.XmlSchemaDatatype类代码示例发布时间:2022-05-26
下一篇:
C# Schema.XmlSchemaComplexContentExtension类代码示例发布时间: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