public void SetUp()
 {
     Configuration = CodeGeneratorConfiguration.Create().MediaTypes;
     Parser = new DocumentTypeInfoParser(Configuration);
     ContentType = new DocumentType();
     Info = ContentType.Info;
     typedInfo = (DocumentTypeInfo) Info;
 }
 public void SetUp()
 {
     Configuration = new CodeGeneratorConfiguration().MediaTypes;
     Candidate = Type = new CodeTypeDeclaration();
     generator = new DocumentTypeInfoGenerator(Configuration);
     documentType = new DocumentType { Info = { Alias = "aClass" } };
     info = (DocumentTypeInfo)documentType.Info;
 }
 public void SetUp()
 {
     Configuration = CodeGeneratorConfiguration.Create().MediaTypes;
     attribute = new CodeAttributeDeclaration("DocumentType");
     generator = new DocumentTypeInfoGenerator(Configuration);
     documentType = new DocumentType
     {
         Info = info = new DocumentTypeInfo {Alias = "aClass"}
     };
 }
 private static void AddAllowedTemplates(CodeTypeDeclaration type, DocumentTypeInfo info)
 {
     if (info.AllowedTemplates.All(String.IsNullOrWhiteSpace))
         return;
     var field = new CodeMemberField(
         typeof (string[]),
         "allowedTemplates"
         );
     var expressions = 
         info.AllowedTemplates
             .NonNullOrWhiteSpace()
             .AsPrimitiveExpressions();
     field.InitExpression = new CodeArrayCreateExpression(
         typeof(string[]),
         expressions
         );
     type.Members.Add(field);
 }
 private static void MapDocumentTypeInfo(IContentType umbracoContentType, DocumentTypeInfo info)
 {
     MapInfo(umbracoContentType, info);
     info.AllowedTemplates = umbracoContentType.AllowedTemplates.Select(t => t.Alias).ToList();
     info.DefaultTemplate = umbracoContentType.DefaultTemplate != null ? umbracoContentType.DefaultTemplate.Alias : null;
     info.Master = umbracoContentType.ParentId > -1
                 ? umbracoContentType.ContentTypeComposition.First(cmp => cmp.Id == umbracoContentType.ParentId).Alias
                 : "";
 }
 protected bool Equals(DocumentTypeInfo other)
 {
     return AllowedTemplates.NullableSequenceEqual(AllowedTemplates) && string.Equals(DefaultTemplate, other.DefaultTemplate);
 }
 public DocumentType()
 {
     Info = new DocumentTypeInfo();
 }
 protected bool Equals(DocumentTypeInfo other)
 {
     return(AllowedTemplates.NullableSequenceEqual(AllowedTemplates) && string.Equals(DefaultTemplate, other.DefaultTemplate));
 }