Пример #1
0
        public override bool Equals(object o)
        {
            TempAssemblyCacheKey key = o as TempAssemblyCacheKey;

            if (key == null)
            {
                return(false);
            }
            return(key._type == _type && key._ns == _ns);
        }
Пример #2
0
        internal void Add(string ns, object o, TempAssembly assembly)
        {
            TempAssemblyCacheKey key = new TempAssemblyCacheKey(ns, o);

            lock (this)
            {
                TempAssembly tempAssembly;
                if (_cache.TryGetValue(key, out tempAssembly) && tempAssembly == assembly)
                {
                    return;
                }
                _cache      = new Dictionary <TempAssemblyCacheKey, TempAssembly>(_cache); // clone
                _cache[key] = assembly;
            }
        }