public BikeCallback(object target, Type returnType, BikeFunction function) { callingThread = Thread.CurrentThread; ContextLocal[callingThread] = InterpretationContext.Instance; Target = target; ReturnType = returnType; Function = function; }
public void AddHandler(object target, string name, BikeFunction bikeFunc, Interpreter interpreter, bool isStatic) { var invoker = new BikeCallback(target, null, bikeFunc); var delegateType = isStatic ? ((Type)target).AddHandler(name, invoker.Callback) : target.AddHandler(name, invoker.Callback); invoker.ReturnType = delegateType.GetMethod("Invoke").ReturnType; }