Esempio n. 1
0
 /// <summary>
 /// Sent petition to the service for connection. The request is asnyc type
 /// </summary>
 private async void connectService()
 {
     try
     {
         // Implements new Logica Operador object
         Logica.Operador logOperator = new Logica.Operador();
         // Gets operator from application variable
         Operador opLogged = App.Current.Properties["user"] as Operador;
         // Gets interface from current
         Entidades.Service.Interface.IServicioCallback callbackForUI = this as Entidades.Service.Interface.IServicioCallback;
         // Calls operation method to connect to the service
         if (await logOperator.ConnectOperatorToService(opLogged, callbackForUI))
         {
             // Shows connection status on the UI
             currentStatus = AvailabiltyStatus.ReadyToReceive;
         }
         else
         {
             // If the connection has been rejected, shows on the UI the results
             currentStatus = AvailabiltyStatus.Disconnected;
         }
     }
     catch (Exception ex)
     {
         Util.MsgBox.Error("Ha ocurrido un error al procesar la solicitud de conexión : " + ex.Message);
         currentStatus = AvailabiltyStatus.Error;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Remove operator from the service
 /// </summary>
 /// <param name="callbackFromClient">Callback of the operator to disconnect</param>
 private void removeOperator(Entidades.Service.Interface.IServicioCallback callbackFromClient)
 {
 }