Ejemplo n.º 1
0
        public RemoteServiceResponse Monitor(string variableName)
        {
            try
            {
                if (!TryToConnect())
                {
                    return new RemoteServiceResponse {
                               HasError = true, Error = "No Connection"
                    }
                }
                ;

                return(Connection.SendReceiveObject <NetworkEvent, RemoteServiceResponse>("RS.MONITOR", "RemoteServiceResponse", DefaultTimeout, NetworkEvent.Create(variableName)));
            }
            catch (Exception ex)
            {
                return(new RemoteServiceResponse {
                    HasError = true, Error = ex.Message
                });
            }
        }
Ejemplo n.º 2
0
        public RemoteServiceResponse SetValue(string variableName, double newValue)
        {
            try
            {
                if (!TryToConnect())
                {
                    return new RemoteServiceResponse {
                               HasError = true, Error = "No Connection"
                    }
                }
                ;

                return(Connection.SendReceiveObject <NetworkEvent, RemoteServiceResponse>("RS.SETVALUE", "RemoteServiceResponse", DefaultTimeout, NetworkEvent.Create(variableName).WithEventTrigger(newValue.ToString(CultureInfo.InvariantCulture))));
            }
            catch (Exception ex)
            {
                return(new RemoteServiceResponse {
                    HasError = true, Error = ex.ToString()
                });
            }
        }