Exemple #1
0
 private ClrFunctionInstance WrapDelegate(EchoDelegate _delegate)
 {
     return(Engine.AsJsFunction(new Func <JsValue, JsValue[], JsValue>((thisObject, args) => {
         _delegate(((args[0].IsNull() || args[0].IsUndefined()) ? null : ManticoreException.NativeInstanceForObject(args[0].AsObject())), Engine.Converter.AsNativeString(args[1]));
         return JsValue.Undefined;
     })));
 }
Exemple #2
0
 private Action <dynamic, dynamic> WrapDelegate(EchoDelegate _delegate)
 {
     return(new Action <dynamic, dynamic>((error, arg) => {
         _delegate((Engine.IsNullOrUndefined(error) ? null : ManticoreException.NativeInstanceForObject(error)), Engine.Converter.AsNativeString(arg));
     }));
 }
Exemple #3
0
 private Action <dynamic, dynamic> WrapDelegate(FetchedDelegate _delegate)
 {
     return(new Action <dynamic, dynamic>((error, response) => {
         _delegate((Engine.IsNullOrUndefined(error) ? null : ManticoreException.NativeInstanceForObject(error)), Engine.Converter.AsNativeObject(response));
     }));
 }