Ejemplo n.º 1
0
        static InvokeResult EndInvokeMethodInternalWithResult(IInvocableMethodOwnerMirror mirror, IAsyncResult asyncResult)
        {
            var result = EndInvokeMethodInternalWithResultImpl(asyncResult);

            mirror.ProcessResult(result);
            return(result);
        }
Ejemplo n.º 2
0
        public static Task <IInvokeResult> InvokeMethodAsyncWithResult(this IInvocableMethodOwnerMirror mirror, ThreadMirror thread, MethodMirror method, IList <Value> arguments, InvokeOptions options = InvokeOptions.None)
        {
            var tcs = new TaskCompletionSource <IInvokeResult> ();

            BeginInvokeMethod(mirror, thread, method, arguments, options, iar =>
            {
                try {
                    tcs.SetResult(EndInvokeMethodInternalWithResult(mirror, iar));
                } catch (OperationCanceledException) {
                    tcs.TrySetCanceled();
                } catch (Exception ex) {
                    tcs.TrySetException(ex);
                }
            }, null);
            return(tcs.Task);
        }
Ejemplo n.º 3
0
 public static IInvokeResult EndInvokeMethodWithResult(this IInvocableMethodOwnerMirror mirror, IAsyncResult asyncResult)
 {
     return(EndInvokeMethodInternalWithResult(mirror, asyncResult));
 }
Ejemplo n.º 4
0
 public static Value EndInvokeMethod(this IInvocableMethodOwnerMirror mirror, IAsyncResult asyncResult)
 {
     return(EndInvokeMethodInternal(mirror, asyncResult));
 }
Ejemplo n.º 5
0
 public static IAsyncResult BeginInvokeMethod(this IInvocableMethodOwnerMirror mirror, ThreadMirror thread, MethodMirror method, IList <Value> arguments, InvokeOptions options, AsyncCallback callback, object state)
 {
     return(BeginInvokeMethod(mirror.VirtualMachine, thread, method, mirror.GetThisObject(), arguments, options, callback, state));
 }
Ejemplo n.º 6
0
 public static Value InvokeMethod(this IInvocableMethodOwnerMirror mirror, ThreadMirror thread, MethodMirror method, IList <Value> arguments, InvokeOptions options = InvokeOptions.None)
 {
     return(InvokeMethod(mirror, mirror.VirtualMachine, thread, method, mirror.GetThisObject(), arguments, options));
 }
Ejemplo n.º 7
0
 static Value InvokeMethod(IInvocableMethodOwnerMirror mirror, VirtualMachine vm, ThreadMirror thread, MethodMirror method, Value this_obj, IList <Value> arguments, InvokeOptions options)
 {
     return(EndInvokeMethodInternal(mirror, BeginInvokeMethod(vm, thread, method, this_obj, arguments, options, null, null)));
 }
Ejemplo n.º 8
0
        static Value EndInvokeMethodInternal(IInvocableMethodOwnerMirror mirror, IAsyncResult asyncResult)
        {
            InvokeResult res = EndInvokeMethodInternalWithResult(mirror, asyncResult);

            return(res.Result);
        }