Esempio n. 1
0
        internal static string GetMessage(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount)
        {
            string methodName = "UNAVAILABLE";

            methodName = method == null ? methodName: method.Name;
            return(GetMessage(invoker, result, handlerType, method, parameterSourceCount, methodName));
        }
        internal static string GetMessage(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount, string methodName)
        {
            if (result == JsonInvokerValidationResult.MethodNotFound)
                return string.Format(messages[result], handlerType.Name, methodName, invoker.JsonId, invoker.ID);

            if (result == JsonInvokerValidationResult.ParameterCountMismatch)
                return string.Format(messages[result], handlerType.Name, method.Name, invoker.JsonId, invoker.ID, method.GetParameters().Length, parameterSourceCount);

            if (result == JsonInvokerValidationResult.CallbackNotSpecified)
                return string.Format(messages[result], handlerType.Name, invoker.JsonId, invoker.ID);

            if (result == JsonInvokerValidationResult.MethodNotSpecified)
                return string.Format(messages[result], handlerType.Name, invoker.JsonId, invoker.ID);

            return string.Format(messages[JsonInvokerValidationResult.Invalid], handlerType.Name, method.Name);
        }
Esempio n. 3
0
        internal static string GetMessage(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount, string methodName)
        {
            if (result == JsonInvokerValidationResult.MethodNotFound)
            {
                return(string.Format(messages[result], handlerType.Name, methodName, invoker.JsonId, invoker.ID));
            }

            if (result == JsonInvokerValidationResult.ParameterCountMismatch)
            {
                return(string.Format(messages[result], handlerType.Name, method.Name, invoker.JsonId, invoker.ID, method.GetParameters().Length, parameterSourceCount));
            }

            if (result == JsonInvokerValidationResult.CallbackNotSpecified)
            {
                return(string.Format(messages[result], handlerType.Name, invoker.JsonId, invoker.ID));
            }

            if (result == JsonInvokerValidationResult.MethodNotSpecified)
            {
                return(string.Format(messages[result], handlerType.Name, invoker.JsonId, invoker.ID));
            }

            return(string.Format(messages[JsonInvokerValidationResult.Invalid], handlerType.Name, method.Name));
        }
 internal static string GetMessage(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount)
 {
     string methodName = "UNAVAILABLE";
     methodName = method == null ? methodName: method.Name;
     return GetMessage(invoker, result, handlerType, method, parameterSourceCount, methodName);
 }
 internal JsonInvokerValidationException(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount, string methodName)
     : base(JsonInvokerValidationMessages.GetMessage(invoker, result, handlerType, method, parameterSourceCount, methodName))
 {
 }
 internal JsonInvokerValidationException(JsonInvoker invoker, JsonInvokerValidationResult result, Type handlerType, MethodInfo method, int parameterSourceCount, string methodName)
     : base(JsonInvokerValidationMessages.GetMessage(invoker, result, handlerType, method, parameterSourceCount, methodName))
 {
 }