Ejemplo n.º 1
0
        public SystemReferences([NotNull] ITypeSystem typeSystem)
        {
#pragma warning disable CS1720 // Expression will always cause a System.NullReferenceException because the type's default value is null
            GetFieldFromHandle = typeSystem.ImportMethod(() => FieldInfo.GetFieldFromHandle(default(RuntimeFieldHandle)));
            PropertyInfoType   = typeSystem.ImportType <PropertyInfo>();
            GetTypeFromHandle  = typeSystem.ImportMethod(() => Type.GetTypeFromHandle(default(RuntimeTypeHandle)));
            GetPropertyInfo    = typeSystem.TryImportMethod(() => default(Type).GetProperty(default(string), default(BindingFlags)));
        }
Ejemplo n.º 2
0
        public static MethodReference?TryImportMethod(this ITypeSystem typeSystem, Expression <Action> expression)
        {
            GetMethodInfo(expression, out var declaringType, out var methodName, out var argumentTypes);

            return(typeSystem.TryImportMethod(declaringType, methodName, argumentTypes));
        }
Ejemplo n.º 3
0
 public static MethodReference?TryImportMethod <T, TP1, TP2, TP3>(this ITypeSystem typeSystem, string name)
 {
     return(typeSystem.TryImportMethod <T>(name, typeof(TP1), typeof(TP2), typeof(TP3)));
 }
Ejemplo n.º 4
0
 public static MethodReference?TryImportMethod <T>(this ITypeSystem typeSystem, string name, params Type[] argumentTypes)
 {
     return(typeSystem.TryImportMethod(typeof(T), name, argumentTypes));
 }