Пример #1
0
        public static Task <TResult> InvokeT <TResult>(this ServiceDelegateStub serviceDelegateStub, uint methodId, string forwardKey, params object[] args)
        {
            var op  = serviceDelegateStub.Invoke <TResult>(methodId, forwardKey, args);
            var tcs = new TaskCompletionSource <TResult>();

            op.Callback = operation =>
            {
                if (!operation.IsComplete)
                {
                    tcs.SetException(new Exception());
                }
                else
                {
                    tcs.SetResult(operation.Result);
                }
            };

            return(tcs.Task);
        }
Пример #2
0
 public InvokeOperation <Boolean> AskMoveTo(Int32 x, Int32 y)
 {
     return(serviceDelegateStub.Invoke <Boolean>(MethodId.AskMoveTo, null, x, y));
 }
Пример #3
0
 public InvokeOperation <ServerList> AskLogin(String username, String password, Byte[] uuid)
 {
     return(serviceDelegateStub.Invoke <ServerList>(MethodId.AskLogin, null, username, password, uuid));
 }
Пример #4
0
 public InvokeOperation <Boolean> AskChangeName(UInt64 pid, String newName)
 {
     return(serviceDelegateStub.Invoke <Boolean>(MethodId.AskChangeName, null, pid, newName));
 }