public FieldsGenerator(ModelBase model, IList<Field> fields, string padding = "")
     : base(model)
 {
     foreach (Field field in fields.OrderBy(x => x.Name))
     {
         GenerateField(field, padding);
     }
 }
        public ModelBuilder(SchemaData schema, ModelBase model)
        {
            XDocument doc = XDocument.Parse(schema.Xsd);
            model.Name = schema.Title;

            if (model is EmbeddedModel)
            {
                XElement complexType = doc.Root.Descendants(Constants.XSD_NAMESPACE + "complexType")
                    .FirstOrDefault(x => x.Attribute("name") != null && x.Attribute("name").Value == schema.RootElementName);
                new FieldsBuilder(complexType, model.Fields);
            }
            else
            {
                XElement content = doc.Root.Descendants(Constants.XSD_NAMESPACE + "element")
                    .FirstOrDefault(x => x.Attribute("name") != null && x.Attribute("name").Value == "Content");
                new FieldsBuilder(content, model.Fields);

                XElement metadata = doc.Root.Descendants(Constants.XSD_NAMESPACE + "element")
                    .FirstOrDefault(x => x.Attribute("name") != null && x.Attribute("name").Value == "Metadata");
                new FieldsBuilder(metadata, model.MetadataFields);
            }
        }
 public UsingsGenerator(ModelBase model)
     : base(model)
 {
 }
 public GeneratorBase(ModelBase model)
 {
     Model = model;
 }
 public ConstructorGenerator(ModelBase model)
     : base(model)
 {
 }