Пример #1
0
            public override void Execute(XmlRpcValue parms, XmlRpcValue result)
            {
                if (parms[0].Type != XmlRpcType.String)
                {
                    throw new XmlRpcException(METHOD_HELP + ": Invalid argument type");
                }

                var method = this.Server.FindMethod(parms[0].GetString());

                if (method == null)
                {
                    throw new XmlRpcException(METHOD_HELP + ": Unknown method name");
                }

                result.Set(method.Help());
            }
Пример #2
0
        // Execute a named method with the specified params.
        public bool ExecuteMethod(string methodName, XmlRpcValue parms, XmlRpcValue result)
        {
            XmlRpcServerMethod method = FindMethod(methodName);

            if (method == null)
            {
                return(false);
            }

            method.Execute(parms, result);

            // Ensure a valid result value
            if (!result.IsEmpty)
            {
                result.Set("");
            }

            return(true);
        }