예제 #1
0
 static PagesHandler()
 {
     ViewEngine = new VelocityViewEngine();
     ViewEngine.Init();
     SchedulerProvider = Configuration.ConfigUtils.SchedulerProvider;
     SchedulerProvider.Init();
     SchedulerDataProvider = new DefaultSchedulerDataProvider(SchedulerProvider);
 }
예제 #2
0
 static PagesHandler()
 {
     ViewEngine = new VelocityViewEngine();
     ViewEngine.Init();
     SchedulerProvider = Configuration.ConfigUtils.SchedulerProvider;
     SchedulerProvider.Init();
     SchedulerDataProvider = new DefaultSchedulerDataProvider(SchedulerProvider);
 }
        private static IViewEngine CreateViewEngine(Type type, IValueSet settings)
        {
            Precondition.Require(type, () => Error.ArgumentNull("type"));
            if (!typeof(IViewEngine).IsAssignableFrom(type))
            {
                throw Error.IncompatibleViewEngineType(type);
            }

            IViewEngine engine = (IViewEngine)ServiceLocator.Instance.GetService(type);

            if (engine == null)
            {
                throw Error.IncompatibleViewEngineType(type);
            }

            engine.Init(settings);
            return(engine);
        }