コード例 #1
0
ファイル: GlassMapperSc.cs プロジェクト: zell71/Helixbase
        public override IConfigurationLoader[] GetGlassLoaders(Context context)
        {
            var loaders1 = GlassMapperScCustom.GlassLoaders();
            var loaders2 = base.GetGlassLoaders(context);

            return(loaders1.Concat(loaders2).ToArray());
        }
コード例 #2
0
ファイル: GlassMapperSc.cs プロジェクト: zell71/Helixbase
        public override IDependencyResolver CreateResolver()
        {
            var resolver = GlassMapperScCustom.CreateResolver();

            base.CreateResolver(resolver);
            return(resolver);
        }
コード例 #3
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();

            //EditFrameBuilder.EditFrameItemPrefix = "Glass-";
        }
コード例 #4
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);
        }
コード例 #5
0
ファイル: GlassMapperSc.cs プロジェクト: zell71/Helixbase
 public override void PostLoad(IDependencyResolver dependencyResolver)
 {
     GlassMapperScCustom.PostLoad();
     base.PostLoad(dependencyResolver);
 }