Ejemplo n.º 1
0
 internal static void InitializeProviders()
 {
     SiteConfiguration.InitializeProviders(interfaceType =>
     {
         object provider;
         _testProviders.TryGetValue(interfaceType, out provider);
         return(provider);
     });
 }
        protected void Application_Start()
        {
            InitializeDependencyInjection();
            SiteConfiguration.InitializeProviders(DependencyResolver.Current);

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

            RegisterRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();
            _initialized = true;
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
0
        internal static void InitializeProviders()
        {
            object modelServiceProvider;

            if (_testProviders.TryGetValue(typeof(IModelServiceProvider), out modelServiceProvider))
            {
                ((DefaultModelServiceProvider)modelServiceProvider).AddDataModelExtension(new TestDataModelExtensions());
            }

            SiteConfiguration.InitializeProviders(interfaceType =>
            {
                object provider;
                _testProviders.TryGetValue(interfaceType, out provider);
                return(provider);
            });
        }
Ejemplo n.º 5
0
        internal static void InitializeProviders(Type modelServiceProviderType)
        {
            IModelServiceProvider modelServiceProvider =
                (IModelServiceProvider)Activator.CreateInstance(modelServiceProviderType);

            modelServiceProvider.AddDataModelExtension(new DefaultModelBuilder());

            SiteConfiguration.InitializeProviders(interfaceType =>
            {
                object provider;
                if (interfaceType == typeof(IModelServiceProvider))
                {
                    return(modelServiceProvider);
                }
                _testProviders.TryGetValue(interfaceType, out provider);
                return(provider);
            });
        }