Esempio n. 1
0
 protected void SetBaseClass(CodeTypeDeclaration type, Info info)
 {
     var baseReference = String.IsNullOrWhiteSpace(info.Master)
                             ? new CodeTypeReference(Config.BaseClass)
                             : new CodeTypeReference(info.Master.PascalCase());
     type.BaseTypes.Add(baseReference);
 }
Esempio n. 2
0
 public ContentType()
 {
     GenericProperties = new List<GenericProperty>();
     Tabs = new List<Tab>();
     Structure = new List<string>();
     Info = new Info();
     Composition = new List<ContentType>();
 }
 public void SetUp()
 {
     Configuration = CodeGeneratorConfiguration.Create().MediaTypes;
     Generator = new CommonInfoGenerator(Configuration);
     ContentType = new MediaType { Info = { Alias = "anEntity" } };
     Candidate = Type = new CodeTypeDeclaration();
     info = ContentType.Info;
 }
 private static void MapInfo(IContentTypeBase umbracoContentType, Info info)
 {
     info.Alias = umbracoContentType.Alias;
     info.AllowAtRoot = umbracoContentType.AllowedAsRoot;
     info.Description = umbracoContentType.Description;
     info.Icon = umbracoContentType.Icon;
     info.Name = umbracoContentType.Name;
     info.Thumbnail = umbracoContentType.Thumbnail;
 }
 public void SetUp()
 {
     Configuration = new CodeGeneratorConfiguration().MediaTypes;
     Generator = new ClassGenerator(
         Configuration,
         new EntityDescriptionGenerator(Configuration)
         );
     ContentType = new MediaType { Info = { Alias = "anEntity" } };
     EntityDescription = info = ContentType.Info;
     ns = new CodeNamespace("ANamespace");
 }
 private static void MapDocumentTypeInfo(IContentType umbracoContentType, Info info)
 {
     if (!(info is DocumentTypeInfo)) throw new Exception("info is not of type DocumentTypeInfo");
     MapDocumentTypeInfo(umbracoContentType, (DocumentTypeInfo)info);
 }
 public override void OnSerializingInfo(XElement infoElement, Info info)
 {
     var docInfo = (DocumentTypeInfo) info;
     var allowedTemplates = new XElement("AllowedTemplates",
         docInfo.AllowedTemplates
                .Where(t => !String.IsNullOrEmpty(t))
                .Select(t => new XElement("Template", t))
         );
     infoElement.Add(allowedTemplates);
     infoElement.Add(CreateElement("DefaultTemplate", docInfo.DefaultTemplate));
 }
 public virtual void OnSerializingInfo(XElement infoElement, Info info)
 {
 }
 protected void DeserializeCommonInfo(XElement infoElement, Info info)
 {
     info.Name = infoElement.ElementValue("Name");
     info.Alias = infoElement.ElementValue("Alias");
     info.Icon = infoElement.ElementValue("Icon");
     info.Thumbnail = infoElement.ElementValue("Thumbnail");
     info.Description = infoElement.ElementValue("Description");
     info.AllowAtRoot = Convert.ToBoolean(infoElement.ElementValue("AllowAtRoot"));
     info.Master = infoElement.ElementValue("Master");
 }