예제 #1
0
 public ContentRoute(IContentTreeProvider contentTreeProvider)
     : base(string.Empty, new MvcRouteHandler())
 {
     contentTree = contentTreeProvider.GetContentTree();
     Url = GetUrlPattern();
     Constraints = GetConstraints();
     Defaults = GetDefaults();
 }
예제 #2
0
        public override void Spin(IRotorContext context)
        {
            var serviceLocator = GetServiceLocatorFromContext(context);
            contentTreeProvider = serviceLocator.Resolve<IContentTreeProvider>();
            var contentTypeRegistry = serviceLocator.Resolve<IContentTypeRegistry>();

            var contentTypes = (from type in contentTypesToRegister
                                from ContentTypeAttribute attribute in type.GetCustomAttributes(typeof(ContentTypeAttribute), true)
                                select attribute.ToContentType(type)).ToArray();

            contentTypeRegistry.Save(contentTypes);
        }
 public ContentRouteHttpModule(IContentTreeProvider contentTreeProvider)
 {
     this.contentTreeProvider = contentTreeProvider;
 }