/// <summary>
        /// Returns the name of an XML-RPC service method for <paramref name="methodInfo"/>.
        /// </summary>
        /// <param name="methodInfo"></param>
        /// <returns></returns>
        public static string GetXmlRpcServiceMethodName(MethodInfo methodInfo)
        {
            XmlRpcServiceMethodAttribute serviceMethodAttribute =
                (XmlRpcServiceMethodAttribute)Attribute.GetCustomAttribute(methodInfo,
                                                                           typeof(XmlRpcServiceMethodAttribute));

            return(serviceMethodAttribute.Name);
        }
        /// <summary>
        /// Creates a <see cref="XmlRpcServiceMethodInfo"/> object for the <paramref name="methodInfo"/>.
        /// </summary>
        /// <param name="methodInfo"></param>
        /// <returns></returns>
        public static XmlRpcServiceMethodInfo CreateXmlRpcServiceMethodInfo(MethodInfo methodInfo)
        {
            XmlRpcServiceMethodAttribute serviceMethodAttribute =
                (XmlRpcServiceMethodAttribute)Attribute.GetCustomAttribute(methodInfo,
                                                                           typeof(XmlRpcServiceMethodAttribute));

            return(new XmlRpcServiceMethodInfo(serviceMethodAttribute.Name, serviceMethodAttribute.Description,
                                               methodInfo, GetParameterTypes(methodInfo)));
        }
Exemple #3
0
        private static void CreateMethodsMethodsInfo(MethodInfo[] methods,
                                                     IDictionary <string, XmlRpcServiceMethodInfo> serviceMethods)
        {
            for (int i = 0; i < methods.GetLength(0); ++i)
            {
                XmlRpcServiceMethodAttribute serviceMethodAttribute =
                    (XmlRpcServiceMethodAttribute)Attribute.GetCustomAttribute(
                        methods[i],
                        typeof(XmlRpcServiceMethodAttribute));

                if (serviceMethodAttribute != null)
                {
                    XmlRpcServiceMethodInfo xmlRpcServiceMethodInfo =
                        XmlRpcServiceMethodInfo.CreateXmlRpcServiceMethodInfo(
                            methods[i]);

                    serviceMethods.Add(xmlRpcServiceMethodInfo.Name, xmlRpcServiceMethodInfo);
                } // if
            }     // for
        }