Beispiel #1
0
 public override bool Equals(object obj)
 {
     if (obj is ContextAndGenerationKey)
     {
         ContextAndGenerationKey key2 = ((ContextAndGenerationKey)obj);
         return(key2.ContextId == this.contextId && key2.Generation == this.generation);
     }
     else
     {
         return(false);
     }
 }
        private ArrayList GetMatchingKeys(UniqueId contextId)
        {
            if (contextId == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contextId");
            }
            ArrayList list = new ArrayList(2);
            bool      flag = false;

            try
            {
                try
                {
                }
                finally
                {
                    base.CacheLock.AcquireReaderLock(-1);
                    flag = true;
                }
                foreach (object obj2 in base.Entries.Keys)
                {
                    bool flag2 = false;
                    if (obj2 is UniqueId)
                    {
                        flag2 = ((UniqueId)obj2) == contextId;
                    }
                    else
                    {
                        ContextAndGenerationKey key = (ContextAndGenerationKey)obj2;
                        flag2 = key.ContextId == contextId;
                    }
                    if (flag2)
                    {
                        list.Add(obj2);
                    }
                }
            }
            finally
            {
                if (flag)
                {
                    base.CacheLock.ReleaseReaderLock();
                }
            }
            return(list);
        }