Esempio n. 1
0
 /// <summary>
 /// Sendet an jeden Clienten ein DVBCommand. Da es sich um jeden Clienten handelt, gibt es keinen Rückgabewert
 /// Send a DVCommand to each client. Because it is every client, there is no return value
 /// </summary>
 /// <param name="dVBViewerXCommand"></param>
 /// <returns></returns>
 public void SendXCommand(Enums.DVBViewerXCommand dVBViewerXCommand)
 {
     try
     {
         SendXCommandAsync(dVBViewerXCommand);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Sendet an jeden Clienten ein DVBCommand. Da es sich um jeden Clienten handelt, gibt es keinen Rückgabewert
 /// Send a DVCommand to each client. Because it is every client, there is no return value
 /// </summary>
 /// <param name="dVBViewerXCommand"></param>
 /// <returns></returns>
 public async void SendXCommandAsync(Enums.DVBViewerXCommand dVBViewerXCommand)
 {
     try
     {
         foreach (var client in Items)
         {
             await client.SendXCommandAsync(dVBViewerXCommand).ConfigureAwait(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        /// <summary>
        /// Sendet einen Befehl an den Clienten und gibt einen Statuscode über die Antwort zurück.
        /// Sends a command to the client and returns a status code about the response.
        /// </summary>
        /// <param name="dVBViewerCommand"></param>
        /// <returns></returns>
        public Task <HttpStatusCode> SendXCommandAsync(Enums.DVBViewerXCommand dVBViewerCommand)
        {
            var dvbApi = DVBViewerServerApi.GetCurrentInstance();

            if (dvbApi != null)
            {
                return(dvbApi.SendApiDataAsync("dvbcommand", new List <Helper.UriParameter>
                {
                    new Helper.UriParameter("target", Name),
                    new Helper.UriParameter("cmd", $"-x{(int)dVBViewerCommand}")
                }));
            }
            else
            {
                return(Task.FromResult <HttpStatusCode>(0));
            }
        }
 /// <summary>
 /// Sendet einen Befehl an den Clienten und gibt einen Statuscode über die Antwort zurück.
 /// Sends a command to the client and returns a status code about the response.
 /// </summary>
 /// <param name="dVBViewerCommand"></param>
 /// <returns></returns>
 public HttpStatusCode SendXCommand(Enums.DVBViewerXCommand dVBViewerCommand)
 {
     return(SendXCommandAsync(dVBViewerCommand).Result);
 }