示例#1
0
        private static void CacheMppsEntity(ServerAssociationParameters association,
                                            string key,
                                            ModalityPerformedProcedureStepIod ie,
                                            out bool alreadyCached)
        {
            alreadyCached = false;
            ListDictionary mppsAssociationList;

            if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList))
            {
                if (mppsAssociationList.Contains(key))
                {
                    alreadyCached = true;
                }
                else
                {
                    mppsAssociationList.Add(key, ie);
                }
            }
            else
            {
                ListDictionary newList = new ListDictionary();
                newList.Add(key, ie);
                _mppsCache.Add(association.GetHashCode(), newList);
            }
        }
示例#2
0
        private static void RemoveAllAssociationMppsFromCache(ServerAssociationParameters association)
        {
            ListDictionary mppsAssociationList;

            if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList))
            {
                mppsAssociationList.Clear();
                _mppsCache.Remove(association.GetHashCode());
            }
        }
示例#3
0
        private static void RemoveMppsEntityFromCache(ServerAssociationParameters association, string key)
        {
            ListDictionary mppsAssociationList;

            if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList))
            {
                if (mppsAssociationList.Contains(key))
                {
                    mppsAssociationList.Remove(key);
                }
            }
        }
示例#4
0
        private static bool IsMppsEntitycached(ServerAssociationParameters association, string key)
        {
            ListDictionary mppsAssociationList;

            if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList))
            {
                return(false);
            }
            else
            {
                return(mppsAssociationList.Contains(key));
            }
        }
示例#5
0
        private static ModalityPerformedProcedureStepIod GetCachedMppsIod(ServerAssociationParameters association, string cacheKeyId)
        {
            ListDictionary mppsAssociationList;

            if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList))
            {
                if (mppsAssociationList.Contains(cacheKeyId))
                {
                    return(mppsAssociationList[cacheKeyId] as ModalityPerformedProcedureStepIod);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }