Example #1
0
        public bool IsAssignableFrom(TypeProxy type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            return(_type.IsAssignableFrom(type._type));
        }
Example #2
0
        private TypeProxy MakeGenericType(Type templateType, TypeProxy argType)
        {
            if (argType == null)
            {
                throw new ArgumentNullException("argType");
            }

            var templateTypeProxy = MakeTypeProxy(templateType);

            return(templateTypeProxy.MakeGenericType(argType));
        }
Example #3
0
 public bool Equals(TypeProxy other)
 {
     if (other == null)
     {
         return(false);
     }
     else if (Object.ReferenceEquals(this, other))
     {
         return(true);
     }
     else
     {
         return(_type.Equals(other._type));
     }
 }
Example #4
0
        internal TypeProxy MakeTypeProxy(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            TypeProxy proxy;

            if (!_proxies.TryGetValue(type, out proxy))
            {
                proxy = new TypeProxy(_utils, type);

                _proxies.Add(type, proxy);
            }

            return(proxy);
        }
Example #5
0
 public TypeProxy MakeGenericDictionaryType(TypeProxy keyTypeProxy, TypeProxy valueTypeProxy)
 {
     return(MakeGenericType(typeof(IDictionary <,>), keyTypeProxy, valueTypeProxy));
 }
Example #6
0
 public TypeProxy MakeGenericSetType(TypeProxy elementTypeProxy)
 {
     return(MakeGenericType(typeof(ISet <>), elementTypeProxy));
 }
Example #7
0
 public TypeProxy MakeGenericEnumerableType(TypeProxy elementTypeProxy)
 {
     return(MakeGenericType(typeof(IEnumerable <>), elementTypeProxy));
 }
Example #8
0
 public TypeProxy MakeGenericNullableType(TypeProxy valueTypeProxy)
 {
     return(MakeGenericType(typeof(Nullable <>), valueTypeProxy));
 }