コード例 #1
0
        private int SetCacheSizeLimit(SetLimitOptions options)
        {
            IWin32Registry winReg = new Win32Registry();

            if (options.Megabytes < 0)
            {
                winReg.CacheSizeLimit = null;
            }
            else
            {
                winReg.CacheSizeLimit = options.Megabytes * (long)1024 * (long)1024;
            }
            return(ShowCacheSizeLimit(null));
        }
コード例 #2
0
ファイル: Cache.cs プロジェクト: zxasqwsss/CKAN
        private int SetCacheSizeLimit(SetLimitOptions options)
        {
            IConfiguration cfg = ServiceLocator.Container.Resolve <IConfiguration>();

            if (options.Megabytes < 0)
            {
                cfg.CacheSizeLimit = null;
            }
            else
            {
                cfg.CacheSizeLimit = options.Megabytes * (long)1024 * (long)1024;
            }
            return(ShowCacheSizeLimit(null));
        }