Ejemplo n.º 1
0
 public void ReceiveResult(RpcMessage.Result resultMessage)
 {
     result             = resultMessage.CallResult;
     isCompleted        = true;
     isFailed           = resultMessage.IsFailed;
     serverErrorMessage = resultMessage.ErrorMessage;
     if (asyncCallback != null)
     {
         asyncCallback(this);
     }
     waitHandle.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);
        }