示例#1
0
            /// <summary>
            /// 移除缓存
            /// </summary>
            /// <param name="innerKey"></param>
            public static void RemoveCache(string innerKey)
            {
                Dictionary <string, ItemCache> cache = ResSettings.GetCache(typeof(ResPickList)) as Dictionary <string, ItemCache>;

                if (cache != null && cache.ContainsKey(innerKey))
                {
                    cache.Remove(innerKey);
                }
            }
示例#2
0
            public static ItemCache Cached(long pickListId)
            {
                Dictionary <string, ItemCache> cache = ResSettings.GetCache(typeof(ResPickList)) as Dictionary <string, ItemCache>;


                if (cache == null)
                {
                    ResSettings.SetCache(cache = new Dictionary <string, ItemCache>(), typeof(ResPickList));
                }


                foreach (var p in cache)
                {
                    if (p.Value.PKID == pickListId)
                    {
                        return(p.Value);
                    }
                }

                return(Cached(APBplDef.ResPickListBpl.PrimaryGet(pickListId).InnerKey));
            }
示例#3
0
            public static ItemCache Cached(string innerKey)
            {
                Dictionary <string, ItemCache> cache = ResSettings.GetCache(typeof(ResPickList)) as Dictionary <string, ItemCache>;


                if (cache == null)
                {
                    ResSettings.SetCache(cache = new Dictionary <string, ItemCache>(), typeof(ResPickList));
                }


                if (cache.ContainsKey(innerKey))
                {
                    return(cache[innerKey]);
                }


                ItemCache itemCache = new ItemCache(APBplDef.ResPickListItemBpl.GetByPickListInnerKey(innerKey));

                cache[innerKey] = itemCache;


                return(itemCache);
            }