示例#1
0
 public DriversDashboardPage()
 {
     this.InitializeComponent();
     BtnTracking.Toggled  += BtnTracking_Toggled;
     _httpClientService    = new HttpClientService();
     _signalRClientService = new SignalRClientService();
     GlobalHelpers.HubConnection.On <LocationDto, string>("ReceiveLocation", async(locationDto, connectionId) =>
     {
         var request  = new GeolocationRequest(GeolocationAccuracy.High);
         var location = await Geolocation.GetLocationAsync(request);
         if (location != null)
         {
             var gpsLocation = new LocationDto(location.Latitude.ToString(),
                                               location.Longitude.ToString())
             {
                 Altitude = location.Altitude.ToString(),
             };
         }
         var requestResponse = new RequestMatatuResponse
         {
             Driver      = _driverEntity,
             LocationDto = new LocationDto(location.Latitude.ToString(), location.Longitude.ToString()),
             Vehicle     = _driverEntity.Vehicle
         };
         if (GlobalHelpers.HubConnection.State == HubConnectionState.Disconnected)
         {
             await GlobalHelpers.HubConnection.StartAsync();
         }
         await GlobalHelpers.HubConnection.InvokeAsync("SendLocation",
                                                       requestResponse, connectionId);
     });
 }
示例#2
0
 public GlobalHelpers()
 {
     _signalRClientService = new SignalRClientService();
     HubConnection         = _signalRClientService.HubConnection;
 }
 public TestSetController(ISignalRClientService clientService)
 {
     _clientService = clientService;
 }
示例#4
0
 public RepoService(IGitHubService gitHubService, ISignalRClientService signalRClientService)
 {
     _gitHubService = gitHubService;
     _signalRClientService = signalRClientService;
 }