Example #1
0
 public void StoreProxyType(Type result, Type baseType, params Type[] baseInterfaces)
 {
     lock (_lock)
     {
         ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);
         _cache[entry] = result;
     }
 }
Example #2
0
 public Type GetProxyType(Type baseType, params Type[] baseInterfaces)
 {
     lock (_lock)
     {
         ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);
         return(_cache[entry]);
     }
 }
		public void StoreProxyType(Type result, Type baseType, params Type[] baseInterfaces)
		{
            lock (_lock)
            {
                ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);
                _cache[entry] = result;
            }
		}
		public Type GetProxyType(Type baseType, params Type[] baseInterfaces)
		{
            lock (_lock)
            {
                ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);
                return _cache[entry];
            }
		}
		public bool Contains(Type baseType, params Type[] baseInterfaces)
		{
			if (baseType == null)
				return false;

			ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);
			return _cache.ContainsKey(entry);
		}
Example #6
0
        public override bool Equals(object obj)
        {
            if (!(obj is ProxyCacheEntry))
            {
                return(false);
            }

            ProxyCacheEntry other = (ProxyCacheEntry)obj;

            return(hashCode == other.GetHashCode());
        }
Example #7
0
        public bool Contains(Type baseType, params Type[] baseInterfaces)
        {
            if (baseType == null)
            {
                return(false);
            }

            ProxyCacheEntry entry = new ProxyCacheEntry(baseType, baseInterfaces);

            return(_cache.ContainsKey(entry));
        }
        public override bool Equals(object obj)
        {
            if (!(obj is ProxyCacheEntry))
            {
                return(false);
            }

            ProxyCacheEntry other = (ProxyCacheEntry)obj;

            return(hashCode == other.GetHashCode() &&
                   BaseType == other.BaseType &&
                   GetTypes(BaseType, Interfaces).SetEquals(GetTypes(other.BaseType, other.Interfaces)));
        }