Esempio n. 1
0
 /// <summary>
 /// Gets the assembly that contains a type.
 /// </summary>
 /// <param name="type">The type, not null.</param>
 /// <returns>The type's assembly.</returns>
 protected internal abstract StaticAssemblyWrapper GetTypeAssembly(StaticDeclaredTypeWrapper type);
Esempio n. 2
0
 /// <summary>
 /// Gets the namespace that contains a type.
 /// </summary>
 /// <param name="type">The type, not null.</param>
 /// <returns>The type's namespace, or an empty string if it has none.</returns>
 protected internal abstract string GetTypeNamespace(StaticDeclaredTypeWrapper type);
Esempio n. 3
0
 /// <summary>
 /// Creates a wrapper.
 /// </summary>
 /// <param name="policy">The reflection policy.</param>
 /// <param name="handle">The underlying reflection object.</param>
 /// <param name="declaringType">The declaring type.</param>
 /// <param name="reflectedType">The reflected type.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="policy"/>, <paramref name="handle"/>,
 /// <paramref name="declaringType"/>, or <paramref name="reflectedType"/> is null.</exception>
 public StaticFieldWrapper(StaticReflectionPolicy policy, object handle, StaticDeclaredTypeWrapper declaringType,
                           StaticDeclaredTypeWrapper reflectedType)
     : base(policy, handle, declaringType, reflectedType)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Gets the attributes of a type.
 /// </summary>
 /// <param name="type">The type, not null.</param>
 /// <returns>The type attributes.</returns>
 protected internal abstract TypeAttributes GetTypeAttributes(StaticDeclaredTypeWrapper type);
Esempio n. 5
0
        protected internal override IEnumerable <StaticPropertyWrapper> GetTypeProperties(StaticDeclaredTypeWrapper type,
                                                                                          StaticDeclaredTypeWrapper reflectedType)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            foreach (PropertyDefinition propertyHandle in typeHandle.Properties)
            {
                yield return(new StaticPropertyWrapper(this, propertyHandle, type, reflectedType));
            }
        }
Esempio n. 6
0
        protected internal override IEnumerable <StaticTypeWrapper> GetTypeNestedTypes(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            foreach (TypeDefinition nestedTypeHandle in typeHandle.NestedTypes)
            {
                yield return(new StaticDeclaredTypeWrapper(this, nestedTypeHandle, type, type.Substitution));
            }
        }
Esempio n. 7
0
        protected internal override IList <StaticDeclaredTypeWrapper> GetTypeInterfaces(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            return(CollectionUtils.ConvertAllToArray <TypeReference, StaticDeclaredTypeWrapper>(typeHandle.Interfaces, MakeDeclaredType));
        }
 /// <summary>
 /// Creates a wrapper.
 /// </summary>
 /// <param name="policy">The reflection policy.</param>
 /// <param name="handle">The underlying reflection object.</param>
 /// <param name="declaringType">The declaring type, or null if none.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="policy"/> or <paramref name="handle"/> is null.</exception>
 protected StaticSpecialTypeWrapper(StaticReflectionPolicy policy, object handle, StaticDeclaredTypeWrapper declaringType)
     : base(policy, handle, declaringType)
 {
 }
Esempio n. 9
0
        protected internal override IList <StaticGenericParameterWrapper> GetTypeGenericParameters(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            return(CollectionUtils.ConvertAllToArray <GenericParameter, StaticGenericParameterWrapper>(typeHandle.GenericParameters, delegate(GenericParameter parameterHandle)
            {
                return StaticGenericParameterWrapper.CreateGenericTypeParameter(this, parameterHandle, type);
            }));
        }
Esempio n. 10
0
        protected internal override StaticAssemblyWrapper GetTypeAssembly(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typeHandle = (TypeDefinition)type.Handle;

            return(Wrap(typeHandle.Module.Assembly));
        }
Esempio n. 11
0
        protected internal override TypeAttributes GetTypeAttributes(StaticDeclaredTypeWrapper type)
        {
            TypeDefinition typehandle = (TypeDefinition)type.Handle;

            return((TypeAttributes)typehandle.Attributes);
        }
Esempio n. 12
0
 /// <summary>
 /// Creates a wrapper.
 /// </summary>
 /// <param name="policy">The reflection policy.</param>
 /// <param name="handle">The underlying reflection object.</param>
 /// <param name="declaringType">The declaring type.</param>
 /// <param name="reflectedType">The reflected type.</param>
 /// <param name="substitution">The type substitution for generic parameters.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="policy"/>, <paramref name="handle"/>,
 /// or <paramref name="declaringType"/> or <paramref name="reflectedType"/> is null.</exception>
 public StaticMethodWrapper(StaticReflectionPolicy policy, object handle, StaticDeclaredTypeWrapper declaringType,
                            StaticDeclaredTypeWrapper reflectedType, StaticTypeSubstitution substitution)
     : base(policy, handle, declaringType, reflectedType)
 {
     this.substitution = substitution;
 }
Esempio n. 13
0
        /// <summary>
        /// Creates a wrapper.
        /// </summary>
        /// <param name="policy">The reflection policy.</param>
        /// <param name="handle">The underlying reflection object.</param>
        /// <param name="declaringType">The declaring type.</param>
        /// <param name="reflectedType">The reflected type.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="policy"/>, <paramref name="handle"/>,
        /// <paramref name="declaringType"/>, or <paramref name="reflectedType"/> is null.</exception>
        protected StaticReflectedMemberWrapper(StaticReflectionPolicy policy, object handle, StaticDeclaredTypeWrapper declaringType,
                                               StaticDeclaredTypeWrapper reflectedType)
            : base(policy, handle, declaringType)
        {
            if (declaringType == null)
            {
                throw new ArgumentNullException("declaringType");
            }
            if (reflectedType == null)
            {
                throw new ArgumentNullException("reflectedType");
            }

            this.reflectedType = reflectedType;
        }
Esempio n. 14
0
 /// <summary>
 /// Gets the base type of atype.
 /// </summary>
 /// <param name="type">The type, not null.</param>
 /// <returns>The base type.</returns>
 protected internal abstract StaticDeclaredTypeWrapper GetTypeBaseType(StaticDeclaredTypeWrapper type);
Esempio n. 15
0
        protected internal override IEnumerable <StaticConstructorWrapper> GetTypeConstructors(StaticDeclaredTypeWrapper type)
        {
            var typeHandle = (TypeDefinition)type.Handle;

            foreach (var methodHandle in GetConstructors(typeHandle.Methods))
            {
                yield return(new StaticConstructorWrapper(this, methodHandle, type));
            }
        }
Esempio n. 16
0
 /// <summary>
 /// Gets the interfaces directly implemented by a type.
 /// </summary>
 /// <param name="type">The type, not null.</param>
 /// <returns>The type's interfaces.</returns>
 protected internal abstract IList <StaticDeclaredTypeWrapper> GetTypeInterfaces(StaticDeclaredTypeWrapper type);
 /// <summary>
 /// Creates a wrapper.
 /// </summary>
 /// <param name="policy">The reflection policy.</param>
 /// <param name="handle">The underlying reflection object.</param>
 /// <param name="declaringType">The declaring type.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="policy"/>, <paramref name="handle"/>,
 /// or <paramref name="declaringType"/> is null.</exception>
 public StaticConstructorWrapper(StaticReflectionPolicy policy, object handle, StaticDeclaredTypeWrapper declaringType)
     : base(policy, handle, declaringType, declaringType)
 {
 }