コード例 #1
0
        public static ViewModelCache GetViewModelCache(this IZetboxContext ctx, IPerfCounter perfCounter)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException("ctx");
            }

            object result;

            if (!ctx.TransientState.TryGetValue(CacheKey, out result))
            {
                result = new ViewModelCache(perfCounter);
                ctx.TransientState[CacheKey] = result;
            }

            return((ViewModelCache)result);
        }
コード例 #2
0
ファイル: ViewModelCache.cs プロジェクト: daszat/zetbox
        public static ViewModelCache GetViewModelCache(this IZetboxContext ctx, IPerfCounter perfCounter)
        {
            if (ctx == null) throw new ArgumentNullException("ctx");

            object result;
            if (!ctx.TransientState.TryGetValue(CacheKey, out result))
            {
                result = new ViewModelCache(perfCounter);
                ctx.TransientState[CacheKey] = result;
            }

            return (ViewModelCache)result;
        }