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


C# Schema.XmlSchemaComplexContentExtension類代碼示例

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


XmlSchemaComplexContentExtension類屬於System.Xml.Schema命名空間,在下文中一共展示了XmlSchemaComplexContentExtension類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Visit

        protected override void Visit(XmlSchemaComplexContentExtension extension)
        {
            var baseType = _schemaSetManager.SchemaSet.GlobalTypes[extension.BaseTypeName] as XmlSchemaComplexType;

            if (baseType != null)
            {
                if (baseType.ContentType == XmlSchemaContentType.ElementOnly ||
                    baseType.ContentType == XmlSchemaContentType.Mixed)
                {
                    if (extension.Particle == null)
                    {
                        Traverse(baseType);
                    }
                    else
                    {
                        PushNode(ChildType.Sequence, extension, null);
                        Traverse(baseType);
                        Traverse(extension.Particle);
                        PopNode();
                    }

                    return;
                }
            }

            if (extension.Particle != null)
                Traverse(extension.Particle);
        }
開發者ID:sergey-steinvil,項目名稱:xsddoc,代碼行數:28,代碼來源:ChildrenFinder.cs

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

示例3: AssertCompiledComplexContentExtension

		public static void AssertCompiledComplexContentExtension (XmlSchemaComplexContentExtension xccx,
			int attributeCount, bool hasAnyAttribute, XmlQualifiedName baseTypeName)
		{
			Assert.IsNotNull (xccx);
			Assert.AreEqual (attributeCount, xccx.Attributes.Count);
			Assert.AreEqual (hasAnyAttribute, xccx.AnyAttribute != null);
			Assert.AreEqual (baseTypeName, xccx.BaseTypeName);
			Assert.IsNotNull (xccx.Particle);
		}
開發者ID:nobled,項目名稱:mono,代碼行數:9,代碼來源:XmlSchemaAssertion.cs

示例4: AssertCompiledComplexContentExtension

		protected void AssertCompiledComplexContentExtension (XmlSchemaComplexContentExtension xccx,
			int attributeCount, bool hasAnyAttribute, XmlQualifiedName baseTypeName)
		{
			AssertNotNull (xccx);
			AssertEquals (attributeCount, xccx.Attributes.Count);
			AssertEquals (hasAnyAttribute, xccx.AnyAttribute != null);
			AssertEquals (baseTypeName, xccx.BaseTypeName);
			AssertNotNull (xccx.Particle);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:9,代碼來源:XmlSchemaAssertion.cs

示例5: Write42_XmlSchemaComplexContentExtension

 void Write42_XmlSchemaComplexContentExtension(XmlSchemaComplexContentExtension o) {
     if ((object)o == null) return;
     WriteStartElement("extension");
     
     WriteAttribute(@"id", @"", ((System.String)[email protected]));
     WriteAttributes((XmlAttribute[])[email protected], o);
     if ([email protected]){
         WriteAttribute(@"base", @"", [email protected]);
     }
     Write5_XmlSchemaAnnotation((XmlSchemaAnnotation)[email protected]);
     if ([email protected] is XmlSchemaSequence) {
         Write54_XmlSchemaSequence((XmlSchemaSequence)[email protected]);
     }
     else if ([email protected] is XmlSchemaGroupRef) {
         Write55_XmlSchemaGroupRef((XmlSchemaGroupRef)[email protected]);
     }
     else if ([email protected] is XmlSchemaChoice) {
         Write52_XmlSchemaChoice((XmlSchemaChoice)[email protected]);
     }
     else if ([email protected] is XmlSchemaAll) {
         Write43_XmlSchemaAll((XmlSchemaAll)[email protected]);
     }
     WriteSortedItems(o.Attributes);
     Write33_XmlSchemaAnyAttribute((XmlSchemaAnyAttribute)[email protected]);
     WriteEndElement();
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:26,代碼來源:SchemaObjectWriter.cs

示例6: ExportStructMapping

 private XmlQualifiedName ExportStructMapping(StructMapping mapping, string ns, XmlSchemaElement element)
 {
     if (mapping.TypeDesc.IsRoot)
     {
         this.needToExportRoot = true;
         return XmlQualifiedName.Empty;
     }
     if (mapping.IsAnonymousType)
     {
         if (this.references[mapping] != null)
         {
             throw new InvalidOperationException(Res.GetString("XmlCircularReference2", new object[] { mapping.TypeDesc.Name, "AnonymousType", "false" }));
         }
         this.references[mapping] = mapping;
     }
     XmlSchemaComplexType item = (XmlSchemaComplexType) this.types[mapping];
     if (item == null)
     {
         if (!mapping.IncludeInSchema)
         {
             throw new InvalidOperationException(Res.GetString("XmlCannotIncludeInSchema", new object[] { mapping.TypeDesc.Name }));
         }
         this.CheckForDuplicateType(mapping, mapping.Namespace);
         item = new XmlSchemaComplexType();
         if (!mapping.IsAnonymousType)
         {
             item.Name = mapping.TypeName;
             this.AddSchemaItem(item, mapping.Namespace, ns);
             this.types.Add(mapping, item);
         }
         item.IsAbstract = mapping.TypeDesc.IsAbstract;
         bool isOpenModel = mapping.IsOpenModel;
         if ((mapping.BaseMapping != null) && mapping.BaseMapping.IncludeInSchema)
         {
             if (mapping.BaseMapping.IsAnonymousType)
             {
                 throw new InvalidOperationException(Res.GetString("XmlAnonymousBaseType", new object[] { mapping.TypeDesc.Name, mapping.BaseMapping.TypeDesc.Name, "AnonymousType", "false" }));
             }
             if (mapping.HasSimpleContent)
             {
                 XmlSchemaSimpleContent content = new XmlSchemaSimpleContent();
                 XmlSchemaSimpleContentExtension extension = new XmlSchemaSimpleContentExtension {
                     BaseTypeName = this.ExportStructMapping(mapping.BaseMapping, mapping.Namespace, null)
                 };
                 content.Content = extension;
                 item.ContentModel = content;
             }
             else
             {
                 XmlSchemaComplexContentExtension extension2 = new XmlSchemaComplexContentExtension {
                     BaseTypeName = this.ExportStructMapping(mapping.BaseMapping, mapping.Namespace, null)
                 };
                 XmlSchemaComplexContent content2 = new XmlSchemaComplexContent {
                     Content = extension2,
                     IsMixed = XmlSchemaImporter.IsMixed((XmlSchemaComplexType) this.types[mapping.BaseMapping])
                 };
                 item.ContentModel = content2;
             }
             isOpenModel = false;
         }
         this.ExportTypeMembers(item, mapping.Members, mapping.TypeName, mapping.Namespace, mapping.HasSimpleContent, isOpenModel);
         this.ExportDerivedMappings(mapping);
         if (mapping.XmlnsMember != null)
         {
             this.AddXmlnsAnnotation(item, mapping.XmlnsMember.Name);
         }
     }
     else
     {
         this.AddSchemaImport(mapping.Namespace, ns);
     }
     if (mapping.IsAnonymousType)
     {
         this.references[mapping] = null;
         if (element != null)
         {
             element.SchemaType = item;
         }
         return XmlQualifiedName.Empty;
     }
     XmlQualifiedName name = new XmlQualifiedName(item.Name, mapping.Namespace);
     if (element != null)
     {
         element.SchemaTypeName = name;
     }
     return name;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:87,代碼來源:XmlSchemaExporter.cs

示例7: GetAttributeCompletion

		XmlCompletionItemCollection GetAttributeCompletion(XmlSchemaComplexContentExtension extension, XmlNamespaceCollection namespacesInScope)
		{
			XmlCompletionItemCollection completionItems = new XmlCompletionItemCollection();
			
			completionItems.AddRange(GetAttributeCompletion(extension.Attributes, namespacesInScope));
			completionItems.AddRange(GetBaseComplexTypeAttributeCompletion(extension.BaseTypeName, namespacesInScope));
			
			return completionItems;
		}
開發者ID:Netring,項目名稱:SharpDevelop,代碼行數:9,代碼來源:XmlSchemaCompletion.cs

示例8: FindAttribute

		XmlSchemaAttribute FindAttribute(XmlSchemaComplexContentExtension extension, string name)
		{
			return FindAttribute(extension.Attributes, name);
		}
開發者ID:Netring,項目名稱:SharpDevelop,代碼行數:4,代碼來源:XmlSchemaCompletion.cs

示例9: CreateForEachElement

		/// <summary>
		/// Creates an element representing a conditional "ForEach" block, which recursively contains another type
		/// </summary>
		/// <param name="InnerType">The base type for the foreach block to contain</param>
		/// <returns>New schema element for the block</returns>
		static XmlSchemaElement CreateForEachElement(ScriptSchemaStandardType InnerType)
		{
			XmlSchemaComplexContentExtension Extension = new XmlSchemaComplexContentExtension();
			Extension.BaseTypeName = GetQualifiedTypeName(InnerType);
			Extension.Attributes.Add(CreateSchemaAttribute("Name", ScriptSchemaStandardType.BalancedString, XmlSchemaUse.Required));
			Extension.Attributes.Add(CreateSchemaAttribute("Values", ScriptSchemaStandardType.BalancedString, XmlSchemaUse.Required));
			Extension.Attributes.Add(CreateSchemaAttribute("If", ScriptSchemaStandardType.BalancedString, XmlSchemaUse.Optional));

			XmlSchemaComplexContent ContentModel = new XmlSchemaComplexContent();
			ContentModel.Content = Extension;

			XmlSchemaComplexType SchemaType = new XmlSchemaComplexType();
			SchemaType.ContentModel = ContentModel;

			XmlSchemaElement Element = new XmlSchemaElement();
			Element.Name = "ForEach";
			Element.SchemaType = SchemaType;
			return Element;
		}
開發者ID:zhaoyizheng0930,項目名稱:UnrealEngine,代碼行數:24,代碼來源:Schema.cs

示例10: Visit

 protected override void Visit(XmlSchemaComplexContentExtension extension)
 {
     ProcessExtension(extension.BaseTypeName, extension.Attributes, extension.AnyAttribute);
 }
開發者ID:sergey-steinvil,項目名稱:xsddoc,代碼行數:4,代碼來源:AttributeFinder.cs

示例11: GetAttributeCompletionData

		XmlCompletionDataCollection GetAttributeCompletionData(XmlSchemaComplexContentExtension extension)
		{
			XmlCompletionDataCollection data = new XmlCompletionDataCollection();
									
			data.AddRange(GetAttributeCompletionData(extension.Attributes));
			XmlSchemaComplexType baseComplexType = FindNamedType(schema, extension.BaseTypeName);
			if (baseComplexType != null) {
				data.AddRange(GetAttributeCompletionData(baseComplexType));
			}
			
			return data;
		}		
開發者ID:kingjiang,項目名稱:SharpDevelopLite,代碼行數:12,代碼來源:XmlSchemaCompletionData.cs

示例12: WriteComplexSchemaType

                /// <summary>
                ///     Handle derivation by extension.
                ///     If type is null, it'll create a new complexType
                ///     with an XmlAny node in its sequence child node.
                /// </summary>
                public XmlSchemaType WriteComplexSchemaType (Type type)
                {
                        //
                        // Recursively generate schema for all parent types
                        //
                        if (type != null && type.BaseType == typeof (object))
                                return WriteSchemaType (type);

                        XmlSchemaComplexType complexType = new XmlSchemaComplexType ();
                        XmlSchemaSequence sequence;
                        XmlSchemaComplexContentExtension extension = new XmlSchemaComplexContentExtension ();
                        XmlSchemaComplexContent content = new XmlSchemaComplexContent ();

                        complexType.ContentModel = content;
                        content.Content = extension;

                        XmlSchemaType baseSchemaType = WriteSchemaType (type.BaseType);

                        complexType.Name = type.Name;

                        FieldInfo [] fields = type.GetFields (flags);
                        PropertyInfo [] properties = type.GetProperties (flags);

                        try {
                                sequence = PopulateSequence (fields, properties);
                                if (attributes != null) {
                                        foreach (object o in attributes) {
                                                MemberInfo member = (MemberInfo) o;
                                                Type attribute_type = (Type) attributes [o];

                                                complexType.Attributes.Add (WriteSchemaAttribute (member, attribute_type));
                                        }
                                }
                        } catch (ArgumentException e) {
                                throw new ArgumentException (String.Format ("There is an error in '{0}'\n\t{1}", type.Name, e.Message));
                        }

                        extension.BaseTypeName = new XmlQualifiedName (baseSchemaType.Name);
                        extension.Particle = sequence;

                        generatedSchemaTypes.Add (type.FullName, complexType);
                        return complexType;
                }
開發者ID:symform,項目名稱:mono,代碼行數:48,代碼來源:MonoXSD.cs

示例13: Check

		public override void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentExtension value)
		{
			CheckSchemaQName (ctx, value, value.BaseTypeName);
			if (value.BaseTypeName.Namespace == "http://schemas.xmlsoap.org/soap/encoding/" && value.BaseTypeName.Name == "Array")
				ctx.ReportRuleViolation (value, BasicProfileRules.R2110);
		}
開發者ID:jjenki11,項目名稱:blaze-chem-rendering,代碼行數:6,代碼來源:BasicProfileChecker.cs

示例14: ExportStructMapping

        XmlQualifiedName ExportStructMapping(StructMapping mapping, string ns) {
            if (mapping.TypeDesc.IsRoot) return ExportRootMapping(mapping);
            XmlSchemaComplexType type = (XmlSchemaComplexType)types[mapping];
            if (type == null) {
                if (!mapping.IncludeInSchema) throw new InvalidOperationException(Res.GetString(Res.XmlSoapCannotIncludeInSchema, mapping.TypeDesc.Name));
                CheckForDuplicateType(mapping.TypeName, mapping.Namespace);
                type = new XmlSchemaComplexType();
                type.Name = mapping.TypeName;
                types.Add(mapping, type);
                AddSchemaItem(type, mapping.Namespace, ns);
                type.IsAbstract = mapping.TypeDesc.IsAbstract;

                if (mapping.BaseMapping != null && mapping.BaseMapping.IncludeInSchema) {
                    XmlSchemaComplexContentExtension extension = new XmlSchemaComplexContentExtension();
                    extension.BaseTypeName = ExportStructMapping(mapping.BaseMapping, mapping.Namespace);
                    XmlSchemaComplexContent model = new XmlSchemaComplexContent();
                    model.Content = extension;
                    type.ContentModel = model;
                }
                ExportTypeMembers(type, mapping.Members, mapping.Namespace);
                ExportDerivedMappings(mapping);
            }
            else {
                AddSchemaImport(mapping.Namespace, ns);
            }
            return new XmlQualifiedName(type.Name, mapping.Namespace);
        }
開發者ID:ArildF,項目名稱:masters,代碼行數:27,代碼來源:soapschemaexporter.cs

示例15: Check

		public virtual void Check (ConformanceCheckContext ctx, XmlSchemaComplexContentExtension value) {}
開發者ID:nobled,項目名稱:mono,代碼行數:1,代碼來源:ConformanceChecker.cs


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