-
Notifications
You must be signed in to change notification settings - Fork 1
Extensions
The blur extension methods provide utils mainly related to Mono.Cecil.
This namespace provides multiple static classes that provide extension methods that I judge extremely useful.
Converts a Mono.Cecil.*Reference to a System.Reflection.*Info. Example: FieldReference to FieldInfo.
Converts a System.Reflection.*Info to a Mono.Cecil.*Reference. Example: FieldInfo to FieldReference.
Converts a System.Reflection.*Info to a Mono.Cecil.*Definition. Example: FieldInfo to FieldDefinition.
Emits a Mono.Cecil.Cil.Instruction to a System.Reflection.Emit.ILGenerator.
Clones an Instruction to a new Instruction.
Warning: This method does not clone reference operands, such as Instruction and Instruction[].
WIP: This method should theoretically work, but doesn't. Huh.
This namespace provides static classes that provide extension methods on every object, and a lot of extension methods on ILWriter. Since they add so many methods and may prove themselves useless to many users, they are in a different namespace.
This static class provides ILWriter methods for every single .NET CIL operation, including a short description, and typed parameters.
This static class provides a few methods made to use LINQ expressions to easily get an object's field reference, for example. Available methods are:
MethodDefinition FindMethod<T>(this T obj, string name, params Type[] parameterTypes)FieldDefinition FindField<T>(this T obj, Expression<Func<T, object>> expr)PropertyDefinition FindProperty<T>(this T obj, Expression<Func<T, object>> expr)EventDefinition FindEvent<T>(this T obj, Expression<Func<T, object>> expr)
this.FindProperty(x => x.Name); // => PropertyDefinition