Пример #1
0
 public string GetStateNames(StateStructRequest request)
 {
     if (request.state1 < 1 || request.state1 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     if (request.state2 < 1 || request.state2 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     if (request.state3 < 1 || request.state3 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     string ret = _stateNames[request.state1 - 1] + " "
                  + _stateNames[request.state2 - 1] + " "
                  + _stateNames[request.state3 - 1];
     return ret;
 }
Пример #2
0
        public string GetStateNames(StateStructRequest request)
        {
            if (request.state1 < 1 || request.state1 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            if (request.state2 < 1 || request.state2 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            if (request.state3 < 1 || request.state3 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            string ret = _stateNames[request.state1 - 1] + " "
                         + _stateNames[request.state2 - 1] + " "
                         + _stateNames[request.state3 - 1];

            return(ret);
        }
Пример #3
0
        public StateStructResponse GetStateNameStruct(StateStructRequest request)
        {
            var response = new StateStructResponse();

            if (request.state1 < 1 || request.state1 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            if (request.state2 < 1 || request.state2 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            if (request.state3 < 1 || request.state3 > _stateNames.Length)
            {
                throw new XmlRpcFaultException(1, "State number 1 invalid");
            }
            response.stateName1 = _stateNames[request.state1 - 1];
            response.stateName2 = _stateNames[request.state2 - 1];
            response.stateName3 = _stateNames[request.state3 - 1];
            return(response);
        }
Пример #4
0
 public IAsyncResult BeginGetStateNameStruct(
     StateStructRequest request,
     AsyncCallback callback, 
     object asyncState)
 {
     return BeginInvoke(
         MethodBase.GetCurrentMethod(),
         new object[] { request },
         null,
         null);
 }
Пример #5
0
 public StateStructResponse GetStateNameStruct(StateStructRequest request)
 {
     var response = new StateStructResponse();
     if (request.state1 < 1 || request.state1 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     if (request.state2 < 1 || request.state2 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     if (request.state3 < 1 || request.state3 > _stateNames.Length)
         throw new XmlRpcFaultException(1, "State number 1 invalid");
     response.stateName1 = _stateNames[request.state1 - 1];
     response.stateName2 = _stateNames[request.state2 - 1];
     response.stateName3 = _stateNames[request.state3 - 1];
     return response;
 }