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; }
private static void RemoveAllAssociationMppsFromCache(ServerAssociationParameters association) { ListDictionary mppsAssociationList; if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList)) { mppsAssociationList.Clear(); _mppsCache.Remove(association.GetHashCode()); } }
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); } }
private static void RemoveMppsEntityFromCache(ServerAssociationParameters association, string key) { ListDictionary mppsAssociationList; if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList)) { if (mppsAssociationList.Contains(key)) mppsAssociationList.Remove(key); } }
private static bool IsMppsEntitycached(ServerAssociationParameters association, string key) { ListDictionary mppsAssociationList; if (_mppsCache.TryGetValue(association.GetHashCode(), out mppsAssociationList)) return false; else return mppsAssociationList.Contains(key); }