예제 #1
0
        public MrType GetPropertyType()
        {
            var context           = new MRGenericContext(DeclaringType.GetGenericTypeParameters(), ImmutableArray <MrType> .Empty);
            var propertySignature = Definition.DecodeSignature <MrType, MRGenericContext>(DeclaringType.Assembly.TypeProvider, context);

            return(propertySignature.ReturnType);
        }
예제 #2
0
        private void Initialize(
            MethodDefinitionHandle methodDefinitionHandle,
            MrType declaringType,
            MethodDefinition methodDefinition)
        {
            SetDeclaringType(declaringType);
            MethodDefinitionHandle = methodDefinitionHandle;

            MethodDefinition = methodDefinition;

            // Decode the method signature

            var genericMethodParameters
                = MethodDefinition
                  .GetGenericParameters()
                  .Select(h => MrType.CreateFromGenericParameterHandle(h, DeclaringType.Assembly))
                  .ToImmutableArray();

            var context = new MRGenericContext(DeclaringType.GetGenericTypeParameters(), genericMethodParameters);

            MethodSignature = MethodDefinition.DecodeSignature <MrType, MRGenericContext>(
                DeclaringType.Assembly.TypeProvider,
                context);
        }