/// <summary> /// </summary> public override void GenerateSchemaTypeObjects(PropertyInfo property, XmlSchemaType type, int level) { var atts = GetAttributes<ConfigurationPropertyAttribute>(property); if (atts.Length == 0) return; XmlSchemaComplexType ct; if (Generator.ComplexMap.ContainsKey(property.PropertyType)) { //already done the work ct = Generator.ComplexMap[property.PropertyType]; } else { // got to generate a new one ct = new XmlSchemaComplexType { Name = atts[0].Name + "CT" }; ct.AddAnnotation(property, null); ct.CreateSchemaSequenceParticle(); Generator.ComplexMap.Add(property.PropertyType, ct); Generator.Schema.Items.Add(ct); // get all properties from the configuration object var propertyInfos = GetProperties<ConfigurationPropertyAttribute>(property.PropertyType); foreach (var pi in propertyInfos) { var parser = TypeParserFactory.GetParser(Generator, pi); parser.GenerateSchemaTypeObjects(pi, ct, level + 1); } } var element = new XmlSchemaElement { Name = atts[0].Name, // property.PropertyType.Name + "CT", MinOccurs = atts[0].IsRequired ? 1 : 0, SchemaTypeName = new XmlQualifiedName(XmlHelper.PrependNamespaceAlias(ct.Name)) }; var pct = (XmlSchemaComplexType) type; ((XmlSchemaGroupBase) pct.Particle).Items.Add(element); // add the documentation element.AddAnnotation(property, atts[0]); }