2 using System.Threading.Tasks;
3 using GumartinM.JsonRPC4NET;
4 using System.ComponentModel;
6 namespace Example.RemoteAgents.GTKLinux.ViewModel
8 public class ViewModelImpl
10 private static readonly string uriGetCurrentDate = "http://127.0.0.1:8080/spring-mainapp/CurrentDateService.json";
11 private static readonly string uriSetWriteText = "http://127.0.0.1:8080/spring-mainapp/WriteTextService.json";
12 private readonly JsonRpcHttpAsyncClient _remoteClient = new JsonRpcHttpAsyncClient();
14 async public Task<string> GetCurrentDateAsync()
16 return await _remoteClient.PostRemoteServiceAsync<string>(uriGetCurrentDate, "getCurrentDate");
19 async public Task SetWriteTextAsync(params object[] parameters)
21 await _remoteClient.PostRemoteServiceAsync(uriSetWriteText, "setWriteText", parameters);