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); }
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); }