public void ReceiveResult(RpcMessage.Result resultMessage) { mResult = resultMessage.CallResult; mIsCompleted = true; mIsFailed = resultMessage.IsFailed; mServerErrorMessage = resultMessage.ErrorMessage; if (mAsyncCallback != null) { mAsyncCallback(this); } mWaitHandle.Set(); }
public static bool VerifyParameterCount(IList <RpcMessage.Parameter> parameters, int expectedCount, RpcMessage.Result resultMessage) { if (parameters.Count != expectedCount) { if (resultMessage != null) { resultMessage.IsFailed = true; resultMessage.ErrorMessage = "Wrong number of parameters"; } return(false); } return(true); }
public static bool BoolFromMessage(RpcMessage.Parameter parameter, RpcMessage.Result resultMessage, ref bool value) { string error = null; if (!ParameterConverter.BoolFromMessage(parameter, ref value, ref error)) { if (resultMessage != null) { resultMessage.IsFailed = true; resultMessage.ErrorMessage = String.Format("Cannot convert call parameter value into expected bool type ({0})", error); } return(false); } return(true); }