예제 #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();
        }