Beispiel #1
0
        protected void Application_Start()
        {
            InitializeDependencyInjection();
            SiteConfiguration.InitializeProviders(DependencyResolver.Current.GetService);

            DataFormatters.Formatters.Add("json", new JsonFormatter());
            DataFormatters.Formatters.Add("rss", new RssFormatter());
            DataFormatters.Formatters.Add("atom", new AtomFormatter());

            RegisterRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();
            GenericTopic.Register(); // Register generic Topic View Model so that Tridion Docs content can be handled.
            RegisterDisplayModes();
            _initialized = true;
        }
Beispiel #2
0
        internal static void RegisterViewModels()
        {
            // Entity Views
            RegisterViewModel("Article", typeof(Article));
            RegisterViewModel("Image", typeof(Image));
            RegisterViewModel("Download", typeof(Download));
            RegisterViewModel("TestEntity", typeof(TestEntity));

            RegisterViewModel("LanguageSelector", typeof(Common.Models.Configuration));

            RegisterViewModel("Breadcrumb", typeof(NavigationLinks), "Navigation");
            RegisterViewModel("LeftNavigation", typeof(NavigationLinks), "Navigation");
            RegisterViewModel("SiteMap", typeof(SitemapItem), "Navigation");
            RegisterViewModel("SiteMapXml", typeof(SitemapItem), "Navigation");
            RegisterViewModel("TopNavigation", typeof(NavigationLinks), "Navigation");

            RegisterViewModel("PagedList", typeof(ContentList <Teaser>), "List");

            RegisterViewModel("Test:TSI1758Test", typeof(Tsi1758TestEntity));
            RegisterViewModel("Test:TSI1946Test", typeof(Tsi1946TestEntity));
            RegisterViewModel("Test:TSI811Test", typeof(Tsi811TestEntity));
            RegisterViewModel("MediaManager:imagedist", typeof(MediaManagerDistribution));
            RegisterViewModel("Test:TSI1757Test1", typeof(Tsi1757TestEntity1));
            RegisterViewModel("Test:TSI1757Test2", typeof(Tsi1757TestEntity2));
            RegisterViewModel("Test:TSI1757Test3", typeof(Tsi1757TestEntity3));
            RegisterViewModel("Test:CompLinkTest", typeof(CompLinkTest));
            RegisterViewModel("Test:TSI2316Test", typeof(Tsi2316TestEntity));
            RegisterViewModel("Test:TSI2844Test", typeof(Tsi2844TestEntity));
            RegisterViewModel("Test:TSI3010Test", typeof(Tsi3010TestEntity));

            GenericTopic.Register(); // Generic Topic Model

            // Strongly Typed Topic Models
            RegisterViewModel(typeof(TestStronglyTypedTopic));
            RegisterViewModel(typeof(TestSpecializedTopic));

            // Page Views
            RegisterViewModel("GeneralPage", typeof(PageModel));
            RegisterViewModel("IncludePage", typeof(PageModel));
            RegisterViewModel("RedirectPage", typeof(PageModel));

            RegisterViewModel("Test:SimpleTestPage", typeof(PageModel));
            RegisterViewModel("Test:TSI811TestPage", typeof(Tsi811PageModel));
            RegisterViewModel("Test:TSI2285TestPage", typeof(Tsi2285PageModel));

            // Region Views
            RegisterViewModel("2-Column", typeof(RegionModel));
            RegisterViewModel("3-Column", typeof(RegionModel));
            RegisterViewModel("4-Column", typeof(RegionModel));
            RegisterViewModel("Hero", typeof(RegionModel));
            RegisterViewModel("Info", typeof(RegionModel));
            RegisterViewModel("Left", typeof(RegionModel));
            RegisterViewModel("Links", typeof(RegionModel));
            RegisterViewModel("Logo", typeof(RegionModel));
            RegisterViewModel("Main", typeof(RegionModel));
            RegisterViewModel("Nav", typeof(RegionModel));
            RegisterViewModel("Tools", typeof(RegionModel));

            RegisterViewModel("SmartTarget:SmartTargetRegion", typeof(SmartTargetRegion));
            RegisterViewModel("SmartTarget:2-Column", typeof(SmartTargetRegion));

            // Region Views for Include Pages
            RegisterViewModel("Header", typeof(RegionModel));
            RegisterViewModel("Footer", typeof(RegionModel));
            RegisterViewModel("Left Navigation", typeof(RegionModel));
            RegisterViewModel("Content Tools", typeof(RegionModel));
        }