Inheritance: Glass.Mapper.Config
コード例 #1
0
        private static ISitecoreService CreateSitecoreService(Database database)
        {
            var config      = new Glass.Mapper.Sc.Config();
            var depResolver = new Glass.Mapper.Sc.IoC.DependencyResolver(config);
            var ctx         = Context.Create(depResolver);

            return(new SitecoreService(database, ctx));
        }
コード例 #2
0
        public static IDependencyResolver CreateResolver()
        {
            var config = new Glass.Mapper.Sc.Config();

            var dependencyResolver = new DependencyResolver(config);

            // add any changes to the standard resolver here
            return(dependencyResolver);
        }
コード例 #3
0
ファイル: Utilities.cs プロジェクト: rootix/Glass.Mapper
        /// <summary>
        /// Gets the language items.
        /// </summary>
        /// <param name="foundItems">The found items.</param>
        /// <param name="language">The language.</param>
        /// <param name="config"></param>
        /// <returns>IEnumerable{Item}.</returns>
        public static IEnumerable<Item> GetLanguageItems(IEnumerable<Item> foundItems, Language language, Config config)
        {
            if (foundItems == null) return Enumerable.Empty<Item>();

            return foundItems.Select(x => GetLanguageItem(x, language, config)).Where(x => x != null);
        }
コード例 #4
0
ファイル: Utilities.cs プロジェクト: rootix/Glass.Mapper
        public static bool DoVersionCheck(Config config)
        {
            if (config != null && config.ForceItemInPageEditor && GlassHtml.IsInEditingMode)
                return false;


            return Switcher<VersionCountState>.CurrentValue != VersionCountState.Disabled;

        }
コード例 #5
0
ファイル: Utilities.cs プロジェクト: rootix/Glass.Mapper
        /// <summary>
        /// Gets the language item.
        /// </summary>
        /// <param name="foundItem">The found item.</param>
        /// <param name="language">The language.</param>
        /// <returns>Item.</returns>
        public static Item GetLanguageItem(Item foundItem, Language language, Config config)
        {
            if (foundItem == null) return null;

            var item = foundItem.Database.GetItem(foundItem.ID, language);

            if (item == null || (item.Versions.Count == 0 && Utilities.DoVersionCheck(config)))
            {
                return null;
            }

            return item;
        }
コード例 #6
0
 public static IDependencyResolver CreateResolver()
 {
     var config = new Config();
     return new DependencyResolver(config);
 }
コード例 #7
0
 public ItemVersionHandler(Config config)
 {
     _config = config;
 }
コード例 #8
0
 public CachedItemVersionHandler(ICacheManager cacheManager, Config config) : base(config)
 {
     _cacheManager = cacheManager;
 }