コード例 #1
0
        public static PixelDataManager GetInstance(StudyStorageLocation storage)
        {
            string key = storage.Key.ToString();
            lock (_cache)
            {
                PixelDataManager instance = _cache[key] as PixelDataManager;
                if (instance == null)
                {
                    instance = new PixelDataManager(storage);
                    _cache.Add(key, instance, null, Cache.NoAbsoluteExpiration, ImageStreamingServerSettings.Default.CacheRetentionWindow, CacheItemPriority.Default, UnloadPixelDataManager);

                }
                return instance;
            }
        }
コード例 #2
0
        public static PixelDataManager GetInstance(StudyStorageLocation storage)
        {
            string key = storage.Key.ToString();

            lock (_cache)
            {
                PixelDataManager instance = _cache[key] as PixelDataManager;
                if (instance == null)
                {
                    instance = new PixelDataManager(storage);
                    _cache.Add(key, instance, null, Cache.NoAbsoluteExpiration, ImageStreamingServerSettings.Default.CacheRetentionWindow, CacheItemPriority.Default, UnloadPixelDataManager);
                }
                return(instance);
            }
        }
コード例 #3
0
        public static PixelDataManager GetInstance(StudyStorageLocation storage)
        {
            string key = storage.Key.ToString();
            var instance = _cache[key] as PixelDataManager;
            if (instance != null) return instance;

            lock (_insertLock)
            {
                instance = _cache[key] as PixelDataManager;
                if (instance == null)
                {
                    instance = new PixelDataManager(storage);
                    _cache.Add(key, instance, null, Cache.NoAbsoluteExpiration, _cacheRetentionTime, CacheItemPriority.Default, null);
                }

                }
                return instance;
            }
コード例 #4
0
        public static PixelDataManager GetInstance(StudyStorageLocation storage)
        {
            string key      = storage.Key.ToString();
            var    instance = _cache[key] as PixelDataManager;

            if (instance != null)
            {
                return(instance);
            }

            lock (_insertLock)
            {
                instance = _cache[key] as PixelDataManager;
                if (instance == null)
                {
                    instance = new PixelDataManager(storage);
                    _cache.Add(key, instance, null, Cache.NoAbsoluteExpiration, _cacheRetentionTime, CacheItemPriority.Default, null);
                }
            }
            return(instance);
        }
コード例 #5
0
        private static void UnloadPixelDataManager(string key, object value, CacheItemRemovedReason reason)
        {
            PixelDataManager instance = value as PixelDataManager;

            instance.Dispose();
        }