.net - Mono.Cecil GetTypeReference to ICommand -


the system.windows.input.icommand interface has been type forwarded of .net 4.5 being in presentationcore.dll system.dll. have 2 issues:

  1. how can import interface can use return type of property injecting class (don't need property injection, type resolution/importing)?

  2. how can sure resulting assembly work on .net 4 clients don't have .net 4.5 installed , such not have icommand type forwarded system.dll?

the code intended used in custom fody weaver.

you have handle explicitly.

for example finding action can exist in diff assemblies.

var mscorelibdefinition = assemblyresolver.resolve("mscorlib"); var mscoretypes = mscorelibdefinition.mainmodule.types; var systemdefinition = assemblyresolver.resolve("system"); var systemtypes = systemdefinition.mainmodule.types; var actiondefinition = mscoretypes.firstordefault(x => x.name == "action"); if (actiondefinition == null) {     actiondefinition = systemtypes.first(x => x.name == "action"); } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -