Пример #1
0
        public bool IsAssignableFrom(TypeProxy type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

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

            var templateTypeProxy = MakeTypeProxy(templateType);

            return(templateTypeProxy.MakeGenericType(argType));
        }
Пример #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));
     }
 }
Пример #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);
        }
Пример #5
0
 public TypeProxy MakeGenericDictionaryType(TypeProxy keyTypeProxy, TypeProxy valueTypeProxy)
 {
     return(MakeGenericType(typeof(IDictionary <,>), keyTypeProxy, valueTypeProxy));
 }
Пример #6
0
 public TypeProxy MakeGenericSetType(TypeProxy elementTypeProxy)
 {
     return(MakeGenericType(typeof(ISet <>), elementTypeProxy));
 }
Пример #7
0
 public TypeProxy MakeGenericEnumerableType(TypeProxy elementTypeProxy)
 {
     return(MakeGenericType(typeof(IEnumerable <>), elementTypeProxy));
 }
Пример #8
0
 public TypeProxy MakeGenericNullableType(TypeProxy valueTypeProxy)
 {
     return(MakeGenericType(typeof(Nullable <>), valueTypeProxy));
 }