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); }
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; }