var actionDefinition = msCoreTypes.FirstOrDefault(x => x.Name == "Action");
if (actionDefinition == null)
{
actionDefinition = systemTypes.FirstOrDefault(x => x.Name == "Action");
}
On Friday, 10 May 2013 00:23:08 UTC+10, Damian Reeves wrote:
I'm new to Mono.Cecil and I'm trying to do some AOP with it to create a Fody Addin.
I'd like to add a property of type System.Windows.Input.ICommand to a class using Mono.Cecil.
Prior to .NET 4.5 this type existed in PresentationCore, but if .NET 4.5 is installed this type exists in System.dll, thanks to the magic of TypeForwarding.
How can I properly import the type so that it works properly on machines with and without .NET 4.5 (i.e. I need this to work properly whether or not the type has been forwarded) even if the assembly was created on a machine with .NET 4.5?