Inheritance: ContentTypeRegistration
        protected override ContentTypeRegistration CreateRegistration(Type type)
        {
            var documentTypeAttribute = type.GetCodeFirstAttribute <DocumentTypeAttribute>();

            if (documentTypeAttribute != null)
            {
                var props = new List <PropertyRegistration>();
                var tabs  = new List <TabRegistration>();
                var comps = new List <ContentTypeCompositionRegistration>();
                DocumentTypeRegistration registration = new DocumentTypeRegistration(
                    props,
                    tabs,
                    comps,
                    documentTypeAttribute.Alias,
                    documentTypeAttribute.Name,
                    type,
                    documentTypeAttribute);

                return(registration);
            }
            else
            {
                throw new CodeFirstException("The specified type does not have a DocumentTypeAttribute. Type: " + type.Name);
            }
        }
        public bool TryGetDocumentType(Type type, out DocumentTypeRegistration registration)
        {
            ContentTypeRegistration reg;

            if (ContentTypeRegister.TryGetContentType(type, out reg))
            {
                registration = reg as DocumentTypeRegistration;
                return(registration != null);
            }
            else
            {
                registration = null;
                return(false);
            }
        }
 public bool TryGetDocumentType <T>(out DocumentTypeRegistration registration) where T : DocumentTypeBase
 {
     return(TryGetDocumentType(typeof(T), out registration));
 }