コード例 #1
0
        private TypeModel CreateTypeModel(Uri source, XmlSchemaAttributeGroup attributeGroup, NamespaceModel namespaceModel, XmlQualifiedName qualifiedName, List <DocumentationModel> docs)
        {
            var name = "I" + _configuration.NamingProvider.AttributeGroupTypeNameFromQualifiedName(qualifiedName);

            if (namespaceModel != null)
            {
                name = namespaceModel.GetUniqueTypeName(name);
            }

            var interfaceModel = new InterfaceModel(_configuration)
            {
                Name          = name,
                Namespace     = namespaceModel,
                XmlSchemaName = qualifiedName
            };

            interfaceModel.Documentation.AddRange(docs);

            if (namespaceModel != null)
            {
                namespaceModel.Types[name] = interfaceModel;
            }

            if (!qualifiedName.IsEmpty)
            {
                var key = BuildKey(attributeGroup, qualifiedName);
                Types[key] = interfaceModel;
            }

            var items      = attributeGroup.Attributes;
            var properties = CreatePropertiesForAttributes(source, interfaceModel, items.OfType <XmlSchemaAttribute>());

            interfaceModel.Properties.AddRange(properties);
            var interfaces = items.OfType <XmlSchemaAttributeGroupRef>()
                             .Select(a => (InterfaceModel)CreateTypeModel(CodeUtilities.CreateUri(a.SourceUri), AttributeGroups[a.RefName], a.RefName));

            interfaceModel.AddInterfaces(interfaces);

            return(interfaceModel);
        }
コード例 #2
0
ファイル: QueryStorage.cs プロジェクト: kayanme/Dataspace
        internal XmlSchema GetQuerySchema()
        {
            var schema = new XmlSchema {
                TargetNamespace = QuerySpace
            };

            schema.Namespaces.Add("", QuerySpace);
            var allParameters = new StringCollection();

            foreach (var queriesForResourceType in _baseQueries.GroupBy(k => k.ResourceKey)
                     .Where(k => _registrationStorage.IsResourceRegistered(k.Key)))
            {
                var group = new XmlSchemaAttributeGroup();
                group.Name = _registrationStorage[queriesForResourceType.Key].ResourceName.Replace(" ", "_");
                var parameters = queriesForResourceType.SelectMany(k => k.Arguments)
                                 .Distinct(_parameterComparer)
                                 .ToArray();

                allParameters.AddRange(parameters);
                foreach (var attr in parameters.Select(k => new XmlSchemaAttribute {
                    RefName = new XmlQualifiedName(k, QuerySpace)
                }))
                {
                    group.Attributes.Add(attr);
                }
                schema.Items.Add(group);
            }
            foreach (var attr in allParameters.OfType <string>().Distinct().Select(
                         k =>
                         new XmlSchemaAttribute
            {
                Name = k,
                SchemaType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String)
            }))
            {
                schema.Items.Add(attr);
            }

            return(schema);
        }
コード例 #3
0
ファイル: SampleGenerator.cs プロジェクト: shachaoshu/WsdlUI
        XmlSchemaAttribute FindArrayAttribute(XmlSchemaObjectCollection atts)
        {
            foreach (object ob in atts)
            {
                XmlSchemaAttribute att = ob as XmlSchemaAttribute;
                if (att != null && att.RefName == arrayTypeRefName)
                {
                    return(att);
                }

                XmlSchemaAttributeGroupRef gref = ob as XmlSchemaAttributeGroupRef;
                if (gref != null)
                {
                    XmlSchemaAttributeGroup grp = (XmlSchemaAttributeGroup)schemas.Find(gref.RefName, typeof(XmlSchemaAttributeGroup));
                    att = FindArrayAttribute(grp.Attributes);
                    if (att != null)
                    {
                        return(att);
                    }
                }
            }
            return(null);
        }
コード例 #4
0
        static void Check(ConformanceCheckContext ctx, ConformanceChecker checker, Hashtable visitedObjects, XmlSchemaObject value)
        {
            if (value == null)
            {
                return;
            }

            if (visitedObjects.Contains(value))
            {
                return;
            }
            visitedObjects.Add(value, value);

            if (value is XmlSchemaImport)
            {
                XmlSchemaImport so = (XmlSchemaImport)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaAll)
            {
                XmlSchemaAll so = (XmlSchemaAll)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Items);
            }
            else if (value is XmlSchemaAnnotation)
            {
                XmlSchemaAnnotation so = (XmlSchemaAnnotation)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Items);
            }
            else if (value is XmlSchemaAttribute)
            {
                XmlSchemaAttribute so = (XmlSchemaAttribute)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaAttributeGroup)
            {
                XmlSchemaAttributeGroup so = (XmlSchemaAttributeGroup)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
                Check(ctx, checker, visitedObjects, so.RedefinedAttributeGroup);
            }
            else if (value is XmlSchemaAttributeGroupRef)
            {
                XmlSchemaAttributeGroupRef so = (XmlSchemaAttributeGroupRef)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaChoice)
            {
                XmlSchemaChoice so = (XmlSchemaChoice)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Items);
            }
            else if (value is XmlSchemaComplexContent)
            {
                XmlSchemaComplexContent so = (XmlSchemaComplexContent)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Content);
            }
            else if (value is XmlSchemaComplexContentExtension)
            {
                XmlSchemaComplexContentExtension so = (XmlSchemaComplexContentExtension)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Particle);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
            }
            else if (value is XmlSchemaComplexContentRestriction)
            {
                XmlSchemaComplexContentRestriction so = (XmlSchemaComplexContentRestriction)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Particle);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
            }
            else if (value is XmlSchemaComplexType)
            {
                XmlSchemaComplexType so = (XmlSchemaComplexType)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.ContentModel);
                Check(ctx, checker, visitedObjects, so.Particle);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
                Check(ctx, checker, visitedObjects, so.ContentTypeParticle);
                Check(ctx, checker, visitedObjects, so.AttributeWildcard);
            }
            else if (value is XmlSchemaElement)
            {
                XmlSchemaElement so = (XmlSchemaElement)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.SchemaType);
                CheckObjects(ctx, checker, visitedObjects, so.Constraints);
            }
            else if (value is XmlSchemaGroup)
            {
                XmlSchemaGroup so = (XmlSchemaGroup)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Particle);
            }
            else if (value is XmlSchemaGroupRef)
            {
                XmlSchemaGroupRef so = (XmlSchemaGroupRef)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaIdentityConstraint)
            {
                XmlSchemaIdentityConstraint so = (XmlSchemaIdentityConstraint)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Fields);
                Check(ctx, checker, visitedObjects, so.Selector);
            }
            else if (value is XmlSchemaKeyref)
            {
                XmlSchemaKeyref so = (XmlSchemaKeyref)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaRedefine)
            {
                XmlSchemaRedefine so = (XmlSchemaRedefine)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Items);
            }
            else if (value is XmlSchemaSequence)
            {
                XmlSchemaSequence so = (XmlSchemaSequence)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Items);
            }
            else if (value is XmlSchemaSimpleContent)
            {
                XmlSchemaSimpleContent so = (XmlSchemaSimpleContent)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Content);
            }
            else if (value is XmlSchemaSimpleContentExtension)
            {
                XmlSchemaSimpleContentExtension so = (XmlSchemaSimpleContentExtension)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
            }
            else if (value is XmlSchemaSimpleContentRestriction)
            {
                XmlSchemaSimpleContentRestriction so = (XmlSchemaSimpleContentRestriction)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Attributes);
                Check(ctx, checker, visitedObjects, so.AnyAttribute);
                CheckObjects(ctx, checker, visitedObjects, so.Facets);
            }
            else if (value is XmlSchemaSimpleType)
            {
                XmlSchemaSimpleType so = (XmlSchemaSimpleType)value;
                checker.Check(ctx, so);
                Check(ctx, checker, visitedObjects, so.Content);
            }
            else if (value is XmlSchemaSimpleTypeList)
            {
                XmlSchemaSimpleTypeList so = (XmlSchemaSimpleTypeList)value;
                checker.Check(ctx, so);
            }
            else if (value is XmlSchemaSimpleTypeRestriction)
            {
                XmlSchemaSimpleTypeRestriction so = (XmlSchemaSimpleTypeRestriction)value;
                checker.Check(ctx, so);
                CheckObjects(ctx, checker, visitedObjects, so.Facets);
            }
            else if (value is XmlSchemaSimpleTypeUnion)
            {
                XmlSchemaSimpleTypeUnion so = (XmlSchemaSimpleTypeUnion)value;
                checker.Check(ctx, so);
            }
        }
コード例 #5
0
        internal void Depends(XmlSchemaObject item, ArrayList refs)
        {
            if (item == null || scope[item] != null)
            {
                return;
            }

            Type t = item.GetType();

            if (typeof(XmlSchemaType).IsAssignableFrom(t))
            {
                XmlQualifiedName          baseName   = XmlQualifiedName.Empty;
                XmlSchemaType             baseType   = null;
                XmlSchemaParticle         particle   = null;
                XmlSchemaObjectCollection attributes = null;

                if (item is XmlSchemaComplexType)
                {
                    XmlSchemaComplexType ct = (XmlSchemaComplexType)item;
                    if (ct.ContentModel != null)
                    {
                        XmlSchemaContent content = ct.ContentModel.Content;
                        if (content is XmlSchemaComplexContentRestriction)
                        {
                            baseName   = ((XmlSchemaComplexContentRestriction)content).BaseTypeName;
                            attributes = ((XmlSchemaComplexContentRestriction)content).Attributes;
                        }
                        else if (content is XmlSchemaSimpleContentRestriction)
                        {
                            XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;
                            if (restriction.BaseType != null)
                            {
                                baseType = restriction.BaseType;
                            }
                            else
                            {
                                baseName = restriction.BaseTypeName;
                            }
                            attributes = restriction.Attributes;
                        }
                        else if (content is XmlSchemaComplexContentExtension)
                        {
                            XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)content;
                            attributes = extension.Attributes;
                            particle   = extension.Particle;
                            baseName   = extension.BaseTypeName;
                        }
                        else if (content is XmlSchemaSimpleContentExtension)
                        {
                            XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
                            attributes = extension.Attributes;
                            baseName   = extension.BaseTypeName;
                        }
                    }
                    else
                    {
                        attributes = ct.Attributes;
                        particle   = ct.Particle;
                    }
                    if (particle is XmlSchemaGroupRef)
                    {
                        XmlSchemaGroupRef refGroup = (XmlSchemaGroupRef)particle;
                        particle = ((XmlSchemaGroup)schemas.Find(refGroup.RefName, typeof(XmlSchemaGroup), false)).Particle;
                    }
                    else if (particle is XmlSchemaGroupBase)
                    {
                        particle = (XmlSchemaGroupBase)particle;
                    }
                }
                else if (item is XmlSchemaSimpleType)
                {
                    XmlSchemaSimpleType        simpleType = (XmlSchemaSimpleType)item;
                    XmlSchemaSimpleTypeContent content    = simpleType.Content;
                    if (content is XmlSchemaSimpleTypeRestriction)
                    {
                        baseType = ((XmlSchemaSimpleTypeRestriction)content).BaseType;
                        baseName = ((XmlSchemaSimpleTypeRestriction)content).BaseTypeName;
                    }
                    else if (content is XmlSchemaSimpleTypeList)
                    {
                        XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList)content;
                        if (list.ItemTypeName != null && !list.ItemTypeName.IsEmpty)
                        {
                            baseName = list.ItemTypeName;
                        }
                        if (list.ItemType != null)
                        {
                            baseType = list.ItemType;
                        }
                    }
                    else if (content is XmlSchemaSimpleTypeRestriction)
                    {
                        baseName = ((XmlSchemaSimpleTypeRestriction)content).BaseTypeName;
                    }
                    else if (t == typeof(XmlSchemaSimpleTypeUnion))
                    {
                        XmlQualifiedName[] memberTypes = ((XmlSchemaSimpleTypeUnion)item).MemberTypes;

                        if (memberTypes != null)
                        {
                            for (int i = 0; i < memberTypes.Length; i++)
                            {
                                XmlSchemaType type = (XmlSchemaType)schemas.Find(memberTypes[i], typeof(XmlSchemaType), false);
                                AddRef(refs, type);
                            }
                        }
                    }
                }
                if (baseType == null && !baseName.IsEmpty && baseName.Namespace != XmlSchema.Namespace)
                {
                    baseType = (XmlSchemaType)schemas.Find(baseName, typeof(XmlSchemaType), false);
                }

                if (baseType != null)
                {
                    AddRef(refs, baseType);
                }
                if (particle != null)
                {
                    Depends(particle, refs);
                }
                if (attributes != null)
                {
                    for (int i = 0; i < attributes.Count; i++)
                    {
                        Depends(attributes[i], refs);
                    }
                }
            }
            else if (t == typeof(XmlSchemaElement))
            {
                XmlSchemaElement el = (XmlSchemaElement)item;
                if (!el.SubstitutionGroup.IsEmpty)
                {
                    if (el.SubstitutionGroup.Namespace != XmlSchema.Namespace)
                    {
                        XmlSchemaElement head = (XmlSchemaElement)schemas.Find(el.SubstitutionGroup, typeof(XmlSchemaElement), false);
                        AddRef(refs, head);
                    }
                }
                if (!el.RefName.IsEmpty)
                {
                    el = (XmlSchemaElement)schemas.Find(el.RefName, typeof(XmlSchemaElement), false);
                    AddRef(refs, el);
                }
                else if (!el.SchemaTypeName.IsEmpty)
                {
                    XmlSchemaType type = (XmlSchemaType)schemas.Find(el.SchemaTypeName, typeof(XmlSchemaType), false);
                    AddRef(refs, type);
                }
                else
                {
                    Depends(el.SchemaType, refs);
                }
            }
            else if (t == typeof(XmlSchemaGroup))
            {
                Depends(((XmlSchemaGroup)item).Particle);
            }
            else if (t == typeof(XmlSchemaGroupRef))
            {
                XmlSchemaGroup group = (XmlSchemaGroup)schemas.Find(((XmlSchemaGroupRef)item).RefName, typeof(XmlSchemaGroup), false);
                AddRef(refs, group);
            }
            else if (typeof(XmlSchemaGroupBase).IsAssignableFrom(t))
            {
                foreach (XmlSchemaObject o in ((XmlSchemaGroupBase)item).Items)
                {
                    Depends(o, refs);
                }
            }
            else if (t == typeof(XmlSchemaAttributeGroupRef))
            {
                XmlSchemaAttributeGroup group = (XmlSchemaAttributeGroup)schemas.Find(((XmlSchemaAttributeGroupRef)item).RefName, typeof(XmlSchemaAttributeGroup), false);
                AddRef(refs, group);
            }
            else if (t == typeof(XmlSchemaAttributeGroup))
            {
                foreach (XmlSchemaObject o in ((XmlSchemaAttributeGroup)item).Attributes)
                {
                    Depends(o, refs);
                }
            }
            else if (t == typeof(XmlSchemaAttribute))
            {
                XmlSchemaAttribute at = (XmlSchemaAttribute)item;
                if (!at.RefName.IsEmpty)
                {
                    at = (XmlSchemaAttribute)schemas.Find(at.RefName, typeof(XmlSchemaAttribute), false);
                    AddRef(refs, at);
                }
                else if (!at.SchemaTypeName.IsEmpty)
                {
                    XmlSchemaType type = (XmlSchemaType)schemas.Find(at.SchemaTypeName, typeof(XmlSchemaType), false);
                    AddRef(refs, type);
                }
                else
                {
                    Depends(at.SchemaType, refs);
                }
            }
            if (typeof(XmlSchemaAnnotated).IsAssignableFrom(t))
            {
                XmlAttribute[] attrs = (XmlAttribute[])((XmlSchemaAnnotated)item).UnhandledAttributes;

                if (attrs != null)
                {
                    for (int i = 0; i < attrs.Length; i++)
                    {
                        XmlAttribute attribute = attrs[i];
                        if (attribute.LocalName == Wsdl.ArrayType && attribute.NamespaceURI == Wsdl.Namespace)
                        {
                            string           dims;
                            XmlQualifiedName qname = TypeScope.ParseWsdlArrayType(attribute.Value, out dims, item);
                            XmlSchemaType    type  = (XmlSchemaType)schemas.Find(qname, typeof(XmlSchemaType), false);
                            AddRef(refs, type);
                        }
                    }
                }
            }
        }
コード例 #6
0
ファイル: ConformanceChecker.cs プロジェクト: Tsalex71/mono-1
 public virtual void Check(ConformanceCheckContext ctx, XmlSchemaAttributeGroup value)
 {
 }
コード例 #7
0
    public static void Main()
    {
        XmlSchema schema = new XmlSchema();

        // <xs:attributeGroup name="myAttributeGroup">
        XmlSchemaAttributeGroup myAttributeGroup = new XmlSchemaAttributeGroup();

        schema.Items.Add(myAttributeGroup);
        myAttributeGroup.Name = "myAttributeGroup";

        // <xs:attribute name="someattribute1" type="xs:integer"/>
        XmlSchemaAttribute someattribute1 = new XmlSchemaAttribute();

        myAttributeGroup.Attributes.Add(someattribute1);
        someattribute1.Name           = "someattribute1";
        someattribute1.SchemaTypeName = new XmlQualifiedName("integer", "http://www.w3.org/2001/XMLSchema");


        // <xs:attribute name="someattribute2" type="xs:string"/>
        XmlSchemaAttribute someattribute2 = new XmlSchemaAttribute();

        myAttributeGroup.Attributes.Add(someattribute2);
        someattribute2.Name           = "someattribute2";
        someattribute2.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");

        // <xs:complexType name="myElementType">
        XmlSchemaComplexType myElementType = new XmlSchemaComplexType();

        schema.Items.Add(myElementType);
        myElementType.Name = "myElementType";

        // <xs:attributeGroup ref="myAttributeGroup"/>
        XmlSchemaAttributeGroupRef myAttributeGroupRef = new XmlSchemaAttributeGroupRef();

        myElementType.Attributes.Add(myAttributeGroupRef);
        myAttributeGroupRef.RefName = new XmlQualifiedName("myAttributeGroup");

        // <xs:attributeGroup name="myAttributeGroupA">
        XmlSchemaAttributeGroup myAttributeGroupA = new XmlSchemaAttributeGroup();

        schema.Items.Add(myAttributeGroupA);
        myAttributeGroupA.Name = "myAttributeGroupA";

        // <xs:attribute name="someattribute10" type="xs:integer"/>
        XmlSchemaAttribute someattribute10 = new XmlSchemaAttribute();

        myAttributeGroupA.Attributes.Add(someattribute10);
        someattribute10.Name           = "someattribute10";
        someattribute10.SchemaTypeName = new XmlQualifiedName("integer", "http://www.w3.org/2001/XMLSchema");

        // <xs:attribute name="someattribute11" type="xs:string"/>
        XmlSchemaAttribute someattribute11 = new XmlSchemaAttribute();

        myAttributeGroupA.Attributes.Add(someattribute11);
        someattribute11.Name           = "someattribute11";
        someattribute11.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");

        // <xs:attributeGroup name="myAttributeGroupB">
        XmlSchemaAttributeGroup myAttributeGroupB = new XmlSchemaAttributeGroup();

        schema.Items.Add(myAttributeGroupB);
        myAttributeGroupB.Name = "myAttributeGroupB";

        // <xs:attribute name="someattribute20" type="xs:date"/>
        XmlSchemaAttribute someattribute20 = new XmlSchemaAttribute();

        myAttributeGroupB.Attributes.Add(someattribute20);
        someattribute20.Name           = "someattribute20";
        someattribute20.SchemaTypeName = new XmlQualifiedName("date", "http://www.w3.org/2001/XMLSchema");

        // <xs:attributeGroup ref="myAttributeGroupA"/>
        XmlSchemaAttributeGroupRef myAttributeGroupRefA = new XmlSchemaAttributeGroupRef();

        myAttributeGroupB.Attributes.Add(myAttributeGroupRefA);
        myAttributeGroupRefA.RefName = new XmlQualifiedName("myAttributeGroupA");

        XmlSchemaSet schemaSet = new XmlSchemaSet();

        schemaSet.ValidationEventHandler += new ValidationEventHandler(ValidationCallbackOne);
        schemaSet.Add(schema);
        schemaSet.Compile();

        XmlSchema compiledSchema = null;

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

        XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());

        nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
        compiledSchema.Write(Console.Out, nsmgr);
    }
コード例 #8
0
        public void Output(string outputPath)
        {
            if (!XmlLayoutUtilities.XmlLayoutConfiguration.SuppressXSDUpdateMessage)
            {
                Debug.Log("[XmlLayout] Updating XSD File.");
            }

            var xmlTextReader = new XmlTextReader(baseXSDPath);

            XmlSchemaSet schemaSet = new XmlSchemaSet();

            schemaSet.ValidationEventHandler += ValidationCallback;
            schemaSet.Add(XmlSchema.Read(xmlTextReader, ValidationCallback));
            schemaSet.Compile();

            XmlSchema schema = null;

            foreach (XmlSchema s in schemaSet.Schemas())
            {
                schema = s;
            }

            schema.Namespaces.Add(String.Empty, String.Empty);
            schema.Namespaces.Add("xmlLayout", @"XmlLayout");

            if (customAttributesToAddByGroup.Count > 0)
            {
                foreach (var group in customAttributesToAddByGroup)
                {
                    // Custom attribute groups are handled differently
                    if (group.Key == CustomXmlAttribute.eAttributeGroup.Custom)
                    {
                        continue;
                    }

                    XmlSchemaAttributeGroup schemaAttributeGroup = null;
                    if (group.Key != CustomXmlAttribute.eAttributeGroup.Custom)
                    {
                        foreach (DictionaryEntry attributeGroup in schema.AttributeGroups)
                        {
                            if (attributeGroup.Key.ToString().EndsWith(GetAttributeGroupName(group.Key), StringComparison.OrdinalIgnoreCase))
                            {
                                schemaAttributeGroup = (XmlSchemaAttributeGroup)attributeGroup.Value;
                            }
                        }
                    }

                    foreach (var attribute in group.Value)
                    {
                        if (attribute.Value.ValueDataType.Contains(','))
                        {
                            CreateEnumSimpleType(attribute.Value.ValueDataType, schema);

                            schemaAttributeGroup.Attributes.Add(new XmlSchemaAttribute {
                                Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(enumPatterns[attribute.Value.ValueDataType], @"XmlLayout")
                            });
                        }
                        else
                        {
                            schemaAttributeGroup.Attributes.Add(new XmlSchemaAttribute()
                            {
                                Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(attribute.Value.ValueDataType)
                            });
                        }
                    }
                }
            }

            if (customAttributeGroupsToAdd.Count > 0)
            {
                foreach (var group in customAttributeGroupsToAdd)
                {
                    XmlSchemaAttributeGroup schemaAttributeGroup = new XmlSchemaAttributeGroup()
                    {
                        Name = group.GroupName
                    };

                    foreach (var attributeType in group.CustomXmlAttributes)
                    {
                        var tagHandler = GetTestInstance <CustomXmlAttribute>(attributeType);

                        var name = tagHandler.GetType().Name;
                        name = char.ToLower(name[0]) + name.Substring(1).Replace("Attribute", string.Empty);

                        schemaAttributeGroup.Attributes.Add(new XmlSchemaAttribute()
                        {
                            Name = name, SchemaTypeName = new XmlQualifiedName(tagHandler.ValueDataType)
                        });
                    }

                    schema.Items.Add(schemaAttributeGroup);
                }
            }

            if (customElementTagHandlersToAdd.Count > 0)
            {
                var defaultsElement        = (XmlSchemaElement)schema.Elements[new XmlQualifiedName("Defaults", @"XmlLayout")];
                var defaultsComplexType    = (XmlSchemaComplexType)defaultsElement.SchemaType;
                var defaultsComplexContent = (XmlSchemaComplexContentExtension)defaultsComplexType.ContentModel.Content;
                var defaultsChoice         = (XmlSchemaChoice)defaultsComplexContent.Particle;

                foreach (var group in customElementTagHandlersToAdd)
                {
                    XmlSchemaGroup schemaElementGroup = null;
                    foreach (DictionaryEntry elementGroup in schema.Groups)
                    {
                        if (elementGroup.Key.ToString().EndsWith(group.Key, StringComparison.OrdinalIgnoreCase))
                        {
                            schemaElementGroup = (XmlSchemaGroup)elementGroup.Value;
                        }
                    }

                    // We need to create the group
                    if (schemaElementGroup == null)
                    {
                        schemaElementGroup = new XmlSchemaGroup()
                        {
                            Name = group.Key
                        };
                        schemaElementGroup.Particle = new XmlSchemaChoice()
                        {
                        };
                        schema.Items.Add(schemaElementGroup);
                    }

                    foreach (var tag in group.Value)
                    {
                        var useChoice = (!String.IsNullOrEmpty(tag.Value.elementChildType) && tag.Value.elementChildType != "none");

                        var element = new XmlSchemaElement()
                        {
                            Name = tag.Key
                        };
                        schema.Items.Add(element);

                        var complexType    = new XmlSchemaComplexType();
                        var complexContent = new XmlSchemaComplexContent()
                        {
                            IsMixed = true
                        };
                        var choice = new XmlSchemaChoice()
                        {
                            MinOccurs = 0, MaxOccursString = "unbounded"
                        };
                        var extension = new XmlSchemaComplexContentExtension()
                        {
                            Particle = useChoice ? choice : null, BaseTypeName = new XmlQualifiedName(tag.Value.extension, @"XmlLayout")
                        };

                        element.SchemaType       = complexType;
                        complexType.ContentModel = complexContent;
                        complexContent.Content   = extension;

                        if (useChoice)
                        {
                            choice.Items.Add(new XmlSchemaGroupRef {
                                RefName = new XmlQualifiedName(tag.Value.elementChildType, @"XmlLayout")
                            });
                        }

                        // add attributes
                        var attributes = tag.Value.attributes;
                        if (attributes.Count > 0)
                        {
                            foreach (var attribute in attributes)
                            {
                                // If the value contains commas, then it is a comma-seperated list and should be converted into an enum
                                if (attribute.Value.Contains(','))
                                {
                                    if (!enumPatterns.ContainsKey(attribute.Value))
                                    {
                                        CreateEnumSimpleType(attribute.Value, schema);
                                    }

                                    extension.Attributes.Add(new XmlSchemaAttribute {
                                        Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(enumPatterns[attribute.Value], @"XmlLayout")
                                    });
                                }
                                else
                                {
                                    extension.Attributes.Add(new XmlSchemaAttribute()
                                    {
                                        Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(attribute.Value)
                                    });
                                }
                            }
                        }

                        var attributeGroups = tag.Value.attributeGroups;
                        if (attributeGroups.Count > 0)
                        {
                            foreach (var attributeGroup in attributeGroups)
                            {
                                extension.Attributes.Add(new XmlSchemaAttributeGroupRef()
                                {
                                    RefName = new XmlQualifiedName(attributeGroup, @"XmlLayout")
                                });
                            }
                        }

                        var customAttributeGroups = tag.Value.customAttributeGroups;
                        if (customAttributeGroups.Count > 0)
                        {
                            foreach (var customAttributeGroupType in customAttributeGroups)
                            {
                                var customAttributeGroup = GetTestInstance <CustomXmlAttributeGroup>(customAttributeGroupType);
                                extension.Attributes.Add(new XmlSchemaAttributeGroupRef()
                                {
                                    RefName = new XmlQualifiedName(customAttributeGroup.GroupName, @"XmlLayout")
                                });
                            }
                        }

                        // add the reference to the default group
                        var refElement = new XmlSchemaElement()
                        {
                            RefName = new XmlQualifiedName(tag.Key, @"XmlLayout")
                        };
                        schemaElementGroup.Particle.Items.Add(refElement);

                        if (!group.Key.Equals("default", StringComparison.OrdinalIgnoreCase))
                        {
                            var item = new XmlSchemaElement {
                                RefName = new XmlQualifiedName(tag.Key, @"XmlLayout")
                            };
                            defaultsChoice.Items.Add(item);
                        }

                        if (tag.Value.allowAnyAttribute)
                        {
                            extension.AnyAttribute = new XmlSchemaAnyAttribute()
                            {
                                ProcessContents = XmlSchemaContentProcessing.Lax
                            };
                        }

                        customElementsAdded.Add(tag.Key, element);
                    }
                }
            }

#if TEXTMESHPRO_PRESENT
            AddElementToParent(schema, "Button", "TextMeshPro");
            AddElementToParent(schema, "Toggle", "TextMeshPro");
#endif

            if (customAttributesToAddByElement.Count > 0)
            {
                foreach (var elementKVP in customAttributesToAddByElement)
                {
                    try
                    {
                        var attributes = elementKVP.Value;

                        var element = (XmlSchemaElement)schema.Elements[new XmlQualifiedName(elementKVP.Key, @"XmlLayout")];

                        if (element == null)
                        {
                            element = customElementsAdded[elementKVP.Key];
                        }

                        var elementComplexType    = (XmlSchemaComplexType)element.SchemaType;
                        var elementComplexContent = (XmlSchemaComplexContentExtension)elementComplexType.ContentModel.Content;

                        foreach (var attribute in attributes)
                        {
                            // If the value contains commas, then it is a comma-seperated list and should be converted into an enum
                            if (attribute.Value.ValueDataType.Contains(','))
                            {
                                if (!enumPatterns.ContainsKey(attribute.Value.ValueDataType))
                                {
                                    CreateEnumSimpleType(attribute.Value.ValueDataType, schema);
                                }

                                elementComplexContent.Attributes.Add(new XmlSchemaAttribute {
                                    Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(enumPatterns[attribute.Value.ValueDataType], @"XmlLayout")
                                });
                            }
                            else
                            {
                                elementComplexContent.Attributes.Add(new XmlSchemaAttribute()
                                {
                                    Name = attribute.Key, SchemaTypeName = new XmlQualifiedName(attribute.Value.ValueDataType)
                                });
                            }
                        }
                    }
                    catch { }
                }
            }

            if (XmlLayoutUtilities.XmlLayoutConfiguration.AllowAnyAttribute)
            {
                var simpleAttributes = (XmlSchemaAttributeGroup)schema.AttributeGroups[new XmlQualifiedName("simpleAttributes", @"XmlLayout")];
                simpleAttributes.AnyAttribute = new XmlSchemaAnyAttribute()
                {
                    ProcessContents = XmlSchemaContentProcessing.Lax
                };
            }

            // output to file
            using (FileStream file = new FileStream(outputPath, FileMode.Create, FileAccess.ReadWrite))
            {
                using (XmlTextWriter xwriter = new XmlTextWriter(file, new UTF8Encoding()))
                {
                    xwriter.Formatting = Formatting.Indented;
                    schema.Write(xwriter);
                }
            }

            // release the lock on the file
            xmlTextReader.Close();

            SubstituteMVVMAttributeDataTypes(outputPath);
        }
コード例 #9
0
        public void ParentOffersNoExtension(XmlSchemaAttributeGroup parentGroup, XmlSchemaAttribute extensionAttribute)
        {
            var message = String.Format(CultureInfo.CurrentCulture, Resources.ProblemReporterAttributeParentAttributGroupOffersNoExtension, parentGroup.QualifiedName, extensionAttribute.QualifiedName);

            _messageReporter.ReportWarning("XSD0011", message);
        }
コード例 #10
0
 /// <summary>
 /// Define the name to be used when a AttributeGroup is found in the XSD.
 /// </summary>
 /// <param name="qualifiedName">The name as defined in the XSD if present.</param>
 /// <param name="attributeGroup">Original XSD AttributeGroup</param>
 /// <returns>A string with a valid C# identifier name.</returns>
 public virtual string AttributeGroupTypeNameFromQualifiedName(XmlQualifiedName qualifiedName, XmlSchemaAttributeGroup attributeGroup)
 {
     return(QualifiedNameToTitleCase(qualifiedName));
 }
コード例 #11
0
 protected override void Visit(XmlSchemaAttributeGroup group)
 {
     PushTopic(TopicType.AttributeGroup, group.QualifiedName.Namespace, group, group.Name);
     base.Visit(group);
     PopTopic();
 }
コード例 #12
0
 protected override void Visit(XmlSchemaAttributeGroup group)
 {
     AttributeGroups.Add(group);
 }
コード例 #13
0
    private void method_4(XmlSchemaGroupBase A_0, XmlNode A_1, bool A_2)
    {
        int num = 8;
        XmlSchemaComplexType item = new XmlSchemaComplexType {
            Name = A_1.Attributes[BookmarkStart.b("䀭儯弱儳", 8)].Value
        };

        if (A_2)
        {
            string            name = item.Name + BookmarkStart.b("椭䈯崱䄳䘵", num);
            XmlSchemaGroupRef ref2 = new XmlSchemaGroupRef {
                RefName = new XmlQualifiedName(name)
            };
            item.Particle = ref2;
            XmlSchemaGroup group = new XmlSchemaGroup {
                Name     = name,
                Particle = A_0
            };
            this.xmlSchema_0.Items.Add(group);
        }
        else
        {
            item.Particle = A_0;
            item.Particle.MaxOccursString = BookmarkStart.b("嬭帯倱嬳䌵嘷帹夻娽", num);
            item.Particle.MinOccurs       = 0M;
        }
        this.xmlSchema_0.Items.Add(item);
        foreach (XmlNode node4 in A_1.SelectNodes(BookmarkStart.b("䌭ਯ圱堳匵唷弹刻䨽", num), this.xmlNamespaceManager_0))
        {
            this.method_5(node4, A_0);
        }
        foreach (XmlNode node in A_1.SelectNodes(BookmarkStart.b("䌭ਯ唱䘳夵䴷䨹", num), this.xmlNamespaceManager_0))
        {
            XmlAttribute attribute = node.Attributes[BookmarkStart.b("尭唯吱", num)];
            if (attribute != null)
            {
                XmlNode node2 = this.xmlElement_0.SelectSingleNode(BookmarkStart.b("䌭ਯ唱䘳夵䴷䨹朻總⸿⍁⥃⍅畇浉", num) + attribute.Value + BookmarkStart.b("भ洯", num), this.xmlNamespaceManager_0);
                this.method_6(node2, A_0);
            }
            else
            {
                this.method_6(node, A_0);
            }
        }
        XmlSchemaObjectCollection attributes = item.Attributes;

        if (A_2)
        {
            string str2 = item.Name + BookmarkStart.b("漭䐯䘱䘳焵䨷唹䤻丽", num);
            XmlSchemaAttributeGroupRef ref3 = new XmlSchemaAttributeGroupRef {
                RefName = new XmlQualifiedName(str2)
            };
            item.Attributes.Add(ref3);
            XmlSchemaAttributeGroup group2 = new XmlSchemaAttributeGroup {
                Name = str2
            };
            this.xmlSchema_0.Items.Add(group2);
            attributes = group2.Attributes;
        }
        foreach (XmlNode node3 in A_1.SelectNodes(BookmarkStart.b("䌭ਯ匱䀳䈵䨷匹帻䬽㐿❁", num), this.xmlNamespaceManager_0))
        {
            this.method_7(node3, attributes);
        }
        XmlSchemaAttribute attribute2 = new XmlSchemaAttribute {
            Name           = BookmarkStart.b("䜭启", num),
            SchemaTypeName = new XmlQualifiedName(BookmarkStart.b("䜭帯䘱", num), BookmarkStart.b("䘭䐯䘱䐳వ᜷ᔹ䬻䤽㜿汁㍃畅晇╉㹋⥍罏恑摓晕楗留ћ፝ⱟㅡݣ๥൧ݩ൫", num))
        };

        item.Attributes.Add(attribute2);
    }
        void GenerateAndroidAttributesFile(AndroidSdkStructure sdk, string androidNamespaceFile)
        {
            var xs = new XmlSchema {
                TargetNamespace = androidNS
            };

            xs.Namespaces.Add("android", androidNS);

            foreach (var name in new string [] { "color", "reference", "dimension", "fraction" })
            {
                xs.Items.Add(new XmlSchemaSimpleType {
                    Name    = name,
                    Content = new XmlSchemaSimpleTypeRestriction {
                        BaseTypeName = new XmlQualifiedName("string", XmlSchema.Namespace)
                    },
                });
            }

            // We cannot directly define global attributes within this attributeGroup, because such an attribute will become "local".
            // It first needs to be defined globally and then can be referenced within the attributeGroup.
            // Therefore, those attributes within styleables are first flattened and then added globally.
            var existing = new List <AndroidSdkStructure.Attribute> ();

            foreach (var attr in sdk.DeclaredStyleables.SelectMany(ds => ds.Attributes))
            {
                if (existing.Any(e => e.Name == attr.Name))
                {
                    // FIXME: check if the content types are equivalent.
                    continue;
                }
                existing.Add(attr);
                var est = attr.Enumerations != null && attr.Enumerations.Any() ? new XmlSchemaSimpleType {
                    Name = attr.Name + "_values"
                } : null;
                if (est != null)
                {
                    var str = new XmlSchemaSimpleTypeRestriction {
                        BaseTypeName = new XmlQualifiedName("string", XmlSchema.Namespace)
                    };
                    est.Content = str;
                    foreach (var e in attr.Enumerations)
                    {
                        str.Facets.Add(new XmlSchemaEnumerationFacet {
                            Value = e.Name
                        });
                    }
                    xs.Items.Add(est);
                }
                var ad = new XmlSchemaAttribute {
                    Name = attr.Name,
                    // FIXME: handle union of formats,
                    SchemaTypeName = attr.Enumerations.Any() || !attr.Formats.Any() ? null : new XmlQualifiedName(attr.Formats [0].XsdType),
                    SchemaType     = attr.Enumerations.Any() ?
                                     new XmlSchemaSimpleType {
                        Content = attr.Formats.FirstOrDefault()?.Name == "enum" ?
                                  (XmlSchemaSimpleTypeContent)
                                  new XmlSchemaSimpleTypeRestriction {
                            BaseTypeName = new XmlQualifiedName(est.Name, androidNS)
                        } :
                        new XmlSchemaSimpleTypeList {
                            ItemTypeName = new XmlQualifiedName(est.Name, androidNS)
                        }
                    } : null,
                };
                xs.Items.Add(ad);
            }
            foreach (var ds in sdk.DeclaredStyleables)
            {
                var ag = new XmlSchemaAttributeGroup {
                    Name = ds.Name ?? "__global__",
                };
                foreach (var attr in ds.Attributes)
                {
                    ag.Attributes.Add(new XmlSchemaAttribute {
                        RefName = new XmlQualifiedName(attr.Name, androidNS)
                    });
                }
                xs.Items.Add(ag);
            }
            using (var writer = XmlWriter.Create(androidNamespaceFile, new XmlWriterSettings {
                Indent = true
            }))
                xs.Write(writer);
        }
コード例 #15
0
 internal void Depends(XmlSchemaObject item, ArrayList refs)
 {
     if ((item != null) && (this.scope[item] == null))
     {
         Type c = item.GetType();
         if (typeof(XmlSchemaType).IsAssignableFrom(c))
         {
             XmlQualifiedName          empty      = XmlQualifiedName.Empty;
             XmlSchemaType             o          = null;
             XmlSchemaParticle         particle   = null;
             XmlSchemaObjectCollection attributes = null;
             if (item is XmlSchemaComplexType)
             {
                 XmlSchemaComplexType type3 = (XmlSchemaComplexType)item;
                 if (type3.ContentModel != null)
                 {
                     XmlSchemaContent content = type3.ContentModel.Content;
                     if (content is XmlSchemaComplexContentRestriction)
                     {
                         empty      = ((XmlSchemaComplexContentRestriction)content).BaseTypeName;
                         attributes = ((XmlSchemaComplexContentRestriction)content).Attributes;
                     }
                     else if (content is XmlSchemaSimpleContentRestriction)
                     {
                         XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;
                         if (restriction.BaseType != null)
                         {
                             o = restriction.BaseType;
                         }
                         else
                         {
                             empty = restriction.BaseTypeName;
                         }
                         attributes = restriction.Attributes;
                     }
                     else if (content is XmlSchemaComplexContentExtension)
                     {
                         XmlSchemaComplexContentExtension extension = (XmlSchemaComplexContentExtension)content;
                         attributes = extension.Attributes;
                         particle   = extension.Particle;
                         empty      = extension.BaseTypeName;
                     }
                     else if (content is XmlSchemaSimpleContentExtension)
                     {
                         XmlSchemaSimpleContentExtension extension2 = (XmlSchemaSimpleContentExtension)content;
                         attributes = extension2.Attributes;
                         empty      = extension2.BaseTypeName;
                     }
                 }
                 else
                 {
                     attributes = type3.Attributes;
                     particle   = type3.Particle;
                 }
                 if (particle is XmlSchemaGroupRef)
                 {
                     XmlSchemaGroupRef ref2 = (XmlSchemaGroupRef)particle;
                     particle = ((XmlSchemaGroup)this.schemas.Find(ref2.RefName, typeof(XmlSchemaGroup), false)).Particle;
                 }
                 else if (particle is XmlSchemaGroupBase)
                 {
                     particle = (XmlSchemaGroupBase)particle;
                 }
             }
             else if (item is XmlSchemaSimpleType)
             {
                 XmlSchemaSimpleType        type4    = (XmlSchemaSimpleType)item;
                 XmlSchemaSimpleTypeContent content2 = type4.Content;
                 if (content2 is XmlSchemaSimpleTypeRestriction)
                 {
                     o     = ((XmlSchemaSimpleTypeRestriction)content2).BaseType;
                     empty = ((XmlSchemaSimpleTypeRestriction)content2).BaseTypeName;
                 }
                 else if (content2 is XmlSchemaSimpleTypeList)
                 {
                     XmlSchemaSimpleTypeList list = (XmlSchemaSimpleTypeList)content2;
                     if ((list.ItemTypeName != null) && !list.ItemTypeName.IsEmpty)
                     {
                         empty = list.ItemTypeName;
                     }
                     if (list.ItemType != null)
                     {
                         o = list.ItemType;
                     }
                 }
                 else if (content2 is XmlSchemaSimpleTypeRestriction)
                 {
                     empty = ((XmlSchemaSimpleTypeRestriction)content2).BaseTypeName;
                 }
                 else if (c == typeof(XmlSchemaSimpleTypeUnion))
                 {
                     XmlQualifiedName[] memberTypes = ((XmlSchemaSimpleTypeUnion)item).MemberTypes;
                     if (memberTypes != null)
                     {
                         for (int i = 0; i < memberTypes.Length; i++)
                         {
                             XmlSchemaType type5 = (XmlSchemaType)this.schemas.Find(memberTypes[i], typeof(XmlSchemaType), false);
                             this.AddRef(refs, type5);
                         }
                     }
                 }
             }
             if (((o == null) && !empty.IsEmpty) && (empty.Namespace != "http://www.w3.org/2001/XMLSchema"))
             {
                 o = (XmlSchemaType)this.schemas.Find(empty, typeof(XmlSchemaType), false);
             }
             if (o != null)
             {
                 this.AddRef(refs, o);
             }
             if (particle != null)
             {
                 this.Depends(particle, refs);
             }
             if (attributes != null)
             {
                 for (int j = 0; j < attributes.Count; j++)
                 {
                     this.Depends(attributes[j], refs);
                 }
             }
         }
         else if (c == typeof(XmlSchemaElement))
         {
             XmlSchemaElement element = (XmlSchemaElement)item;
             if (!element.SubstitutionGroup.IsEmpty && (element.SubstitutionGroup.Namespace != "http://www.w3.org/2001/XMLSchema"))
             {
                 XmlSchemaElement element2 = (XmlSchemaElement)this.schemas.Find(element.SubstitutionGroup, typeof(XmlSchemaElement), false);
                 this.AddRef(refs, element2);
             }
             if (!element.RefName.IsEmpty)
             {
                 element = (XmlSchemaElement)this.schemas.Find(element.RefName, typeof(XmlSchemaElement), false);
                 this.AddRef(refs, element);
             }
             else if (!element.SchemaTypeName.IsEmpty)
             {
                 XmlSchemaType type6 = (XmlSchemaType)this.schemas.Find(element.SchemaTypeName, typeof(XmlSchemaType), false);
                 this.AddRef(refs, type6);
             }
             else
             {
                 this.Depends(element.SchemaType, refs);
             }
         }
         else if (c == typeof(XmlSchemaGroup))
         {
             this.Depends(((XmlSchemaGroup)item).Particle);
         }
         else if (c == typeof(XmlSchemaGroupRef))
         {
             XmlSchemaGroup group = (XmlSchemaGroup)this.schemas.Find(((XmlSchemaGroupRef)item).RefName, typeof(XmlSchemaGroup), false);
             this.AddRef(refs, group);
         }
         else if (typeof(XmlSchemaGroupBase).IsAssignableFrom(c))
         {
             foreach (XmlSchemaObject obj2 in ((XmlSchemaGroupBase)item).Items)
             {
                 this.Depends(obj2, refs);
             }
         }
         else if (c == typeof(XmlSchemaAttributeGroupRef))
         {
             XmlSchemaAttributeGroup group2 = (XmlSchemaAttributeGroup)this.schemas.Find(((XmlSchemaAttributeGroupRef)item).RefName, typeof(XmlSchemaAttributeGroup), false);
             this.AddRef(refs, group2);
         }
         else if (c == typeof(XmlSchemaAttributeGroup))
         {
             foreach (XmlSchemaObject obj3 in ((XmlSchemaAttributeGroup)item).Attributes)
             {
                 this.Depends(obj3, refs);
             }
         }
         else if (c == typeof(XmlSchemaAttribute))
         {
             XmlSchemaAttribute attribute = (XmlSchemaAttribute)item;
             if (!attribute.RefName.IsEmpty)
             {
                 attribute = (XmlSchemaAttribute)this.schemas.Find(attribute.RefName, typeof(XmlSchemaAttribute), false);
                 this.AddRef(refs, attribute);
             }
             else if (!attribute.SchemaTypeName.IsEmpty)
             {
                 XmlSchemaType type7 = (XmlSchemaType)this.schemas.Find(attribute.SchemaTypeName, typeof(XmlSchemaType), false);
                 this.AddRef(refs, type7);
             }
             else
             {
                 this.Depends(attribute.SchemaType, refs);
             }
         }
         if (typeof(XmlSchemaAnnotated).IsAssignableFrom(c))
         {
             XmlAttribute[] unhandledAttributes = ((XmlSchemaAnnotated)item).UnhandledAttributes;
             if (unhandledAttributes != null)
             {
                 for (int k = 0; k < unhandledAttributes.Length; k++)
                 {
                     XmlAttribute attribute2 = unhandledAttributes[k];
                     if ((attribute2.LocalName == "arrayType") && (attribute2.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/"))
                     {
                         string           str;
                         XmlQualifiedName name  = TypeScope.ParseWsdlArrayType(attribute2.Value, out str, item);
                         XmlSchemaType    type8 = (XmlSchemaType)this.schemas.Find(name, typeof(XmlSchemaType), false);
                         this.AddRef(refs, type8);
                     }
                 }
             }
         }
     }
 }
コード例 #16
0
        private XmlSchemaAnyAttribute GetAnyAttribute(XmlSchemaAttributeGroup group)
        {
            var entries = GetAttributeEntries(group);

            return(entries.AnyAttribute);
        }
コード例 #17
0
ファイル: ParentFinder.cs プロジェクト: paulushub/SandAssists
 protected override void Visit(XmlSchemaAttributeGroup group)
 {
     PushParent(group);
     base.Visit(group);
     PopParent();
 }