Example #1
0
        public static void Start()
        {
            //install the custom services
            var resolver = GlassMapperScCustom.CreateResolver();

            //create a context
            var context = Glass.Mapper.Context.Create(resolver);

            LoadConfigurationMaps(resolver, context);

            context.Load(
                GlassMapperScCustom.GlassLoaders()
                );

            GlassMapperScCustom.PostLoad();
        }
        public static void Start()
        {
            //create the resolver
            var resolver = DependencyResolver.CreateStandardResolver();

            //install the custom services
            GlassMapperScCustom.CastleConfig(resolver.Container);

            //create a context
            var context = Glass.Mapper.Context.Create(resolver);

            context.Load(
                GlassMapperScCustom.GlassLoaders()
                );

            GlassMapperScCustom.PostLoad();
        }
Example #3
0
        public static void LoadConfigurationMaps(IDependencyResolver resolver, Glass.Mapper.Context context)
        {
            var dependencyResolver = resolver as DependencyResolver;

            if (dependencyResolver == null)
            {
                return;
            }

            if (dependencyResolver.ConfigurationMapFactory is ConfigurationMapConfigFactory)
            {
                GlassMapperScCustom.AddMaps(dependencyResolver.ConfigurationMapFactory);
            }

            IConfigurationMap configurationMap = new ConfigurationMap(dependencyResolver);
            SitecoreFluentConfigurationLoader configurationLoader = configurationMap.GetConfigurationLoader <SitecoreFluentConfigurationLoader>();

            context.Load(configurationLoader);
        }
Example #4
0
        public static void Start()
        {
            AreaRegistration.RegisterAllAreas();
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            //create the resolver
            var resolver = Glass.Mapper.Sc.CastleWindsor.DependencyResolver.CreateStandardResolver();

            //install the custom services
            GlassMapperScCustom.CastleConfig(resolver.Container);

            //create a context
            var context = Glass.Mapper.Context.Create(resolver);

            context.Load(
                GlassMapperScCustom.GlassLoaders()
                );

            GlassMapperScCustom.PostLoad();
        }