public Adapter(Object LibraryInstance, String MethodName) { Type libraryType = LibraryInstance.GetType(); Type[] methodParameters = typeof(LibraryDelegate <TRuntimeType>).GetMethod("Invoke").GetParameters().Select(p => p.ParameterType).ToArray(); MethodInfo libMethod = libraryType.GetMethod(MethodName, methodParameters); libDelegate = (LibraryDelegate <TRuntimeType>)Delegate.CreateDelegate(typeof(LibraryDelegate <TRuntimeType>), LibraryInstance, libMethod); }
private LibraryFunction(string n, LibraryDelegate fun) { Name = n; Function = fun; }
private LibraryFunction(IronySymbol n, LibraryDelegate fun) { Name = n; Function = fun; }