Exemplo n.º 1
0
        public bool IsAssignableFrom(TypeProxy type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

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

            var templateTypeProxy = MakeTypeProxy(templateType);

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