Beispiel #1
0
        public void RegisterCached(LoadedAssembly asm, AssemblyTreeNode asmNode)
        {
            CachedAssemblyTreeNode cachedInfo;

            if (!cachedAsmTreeNodes.TryGetValue(asm, out cachedInfo))
            {
                cachedAsmTreeNodes.Add(asm, cachedInfo = new CachedAssemblyTreeNode(asmNode));
            }
            else
            {
                Debug.Assert(cachedInfo.AssemblyTreeNode == asmNode);
                if (cachedInfo.AssemblyTreeNode != asmNode)
                {
                    throw new InvalidOperationException();
                }
            }
            cachedInfo.Counter++;
        }
 public void RegisterCached(LoadedAssembly asm, AssemblyTreeNode asmNode)
 {
     CachedAssemblyTreeNode cachedInfo;
     if (!cachedAsmTreeNodes.TryGetValue(asm, out cachedInfo))
         cachedAsmTreeNodes.Add(asm, cachedInfo = new CachedAssemblyTreeNode(asmNode));
     else {
         Debug.Assert(cachedInfo.AssemblyTreeNode == asmNode);
         if (cachedInfo.AssemblyTreeNode != asmNode)
             throw new InvalidOperationException();
     }
     cachedInfo.Counter++;
 }