@@ -46,13 +46,30 @@ public static object GetSettableValue (this CustomAttributeArgument arg)
4646 return td != null ? td . FullName + "," + td . Module . Assembly . FullName : arg . Value ;
4747 }
4848
49+ #if ! NETCOREAPP
4950 public static AssemblyDefinition GetAssembly ( this LinkContext context , string assemblyName )
5051 {
5152 AssemblyDefinition ad ;
5253 context . TryGetLinkedAssembly ( assemblyName , out ad ) ;
5354 return ad ;
5455 }
5556
57+ public static TypeDefinition GetType ( this LinkContext context , string assemblyName , string typeName )
58+ {
59+ AssemblyDefinition ad = context . GetAssembly ( assemblyName ) ;
60+ return ad == null ? null : GetType ( ad , typeName ) ;
61+ }
62+
63+ public static MethodDefinition GetMethod ( this LinkContext context , string ns , string typeName , string name , string [ ] parameters )
64+ {
65+ var type = context . GetType ( ns , typeName ) ;
66+ if ( type == null )
67+ return null ;
68+
69+ return GetMethod ( type , name , parameters ) ;
70+ }
71+ #endif
72+
5673 public static MethodDefinition GetMethod ( TypeDefinition td , string name )
5774 {
5875 MethodDefinition method = null ;
@@ -66,15 +83,6 @@ public static MethodDefinition GetMethod (TypeDefinition td, string name)
6683 return method ;
6784 }
6885
69- public static MethodDefinition GetMethod ( this LinkContext context , string ns , string typeName , string name , string [ ] parameters )
70- {
71- var type = context . GetType ( ns , typeName ) ;
72- if ( type == null )
73- return null ;
74-
75- return GetMethod ( type , name , parameters ) ;
76- }
77-
7886 public static MethodDefinition GetMethod ( TypeDefinition type , string name , string [ ] parameters )
7987 {
8088 MethodDefinition method = null ;
@@ -103,12 +111,6 @@ public static MethodDefinition GetMethod (TypeDefinition type, string name, stri
103111 return method ;
104112 }
105113
106- public static TypeDefinition GetType ( this LinkContext context , string assemblyName , string typeName )
107- {
108- AssemblyDefinition ad = context . GetAssembly ( assemblyName ) ;
109- return ad == null ? null : GetType ( ad , typeName ) ;
110- }
111-
112114 public static TypeDefinition GetType ( AssemblyDefinition assembly , string typeName )
113115 {
114116 return assembly . MainModule . GetType ( typeName ) ;
0 commit comments