Beispiel #1
0
 public static void Connect(int Port = -1)
 {
     if (Port <= 0)
     {
         Port = DEF_PORT;
     }
     try
     {
         RpcInvokeProxy = new RpcInvokeProxy(Port);
         ServerProxy    = MethodProxy.CreateProxy <IService>(RpcInvokeProxy);
     }
     catch
     {
         if (Port != DEF_PORT)
         {
             try
             {
                 RpcInvokeProxy = new RpcInvokeProxy(DEF_PORT);
                 ServerProxy    = MethodProxy.CreateProxy <IService>(RpcInvokeProxy);
             }
             catch
             {
                 ConnectFail(DEF_PORT);
             }
         }
         else
         {
             ConnectFail(Port);
         }
     }
 }
Beispiel #2
0
 public Task ClipboardCollectionChange(List <ClipboardItem> addItems, List <ClipboardItem> removeItems)
 {
     RpcInvokeProxy.DispatchInvoke(() =>
     {
         foreach (var x in removeItems)
         {
             ClipboardWrapper.Remove(x);
         }
         foreach (var x in addItems)
         {
             ClipboardWrapper.Add(x);
         }
     });
     return(Task.CompletedTask);
 }