CookComputing.XmlRpc.XmlRpcServiceInfo.GetMethod C# (CSharp) Method

GetMethod() public method

public GetMethod ( String methodName ) : CookComputing.XmlRpc.XmlRpcMethodInfo
methodName String
return CookComputing.XmlRpc.XmlRpcMethodInfo
        public XmlRpcMethodInfo GetMethod(
            String methodName)
        {
            foreach (XmlRpcMethodInfo mthdInfo in methodInfos)
              {
            if (mthdInfo.XmlRpcName == methodName)
              return mthdInfo;
              }
              return null;
        }

Usage Example

Esempio n. 1
0
        public Array System__Method__Signature___(string MethodName)
        {
            //TODO: support overloaded methods
            XmlRpcServiceInfo svcInfo = XmlRpcServiceInfo.CreateServiceInfo(
                this.GetType());
            XmlRpcMethodInfo mthdInfo = svcInfo.GetMethod(MethodName);

            if (mthdInfo == null)
            {
                throw new XmlRpcFaultException("880",
                                               "Request for information on unsupported method");
            }
            if (mthdInfo.IsHidden)
            {
                throw new XmlRpcFaultException("881",
                                               "Information not available on this method");
            }
            //XmlRpcTypes.CheckIsXmlRpcMethod(mi);
            ArrayList alist = new ArrayList();

            alist.Add(XmlRpcServiceInfo.GetXmlRpcTypeString(mthdInfo.ReturnType));
            foreach (XmlRpcParameterInfo paramInfo in mthdInfo.Parameters)
            {
                alist.Add(XmlRpcServiceInfo.GetXmlRpcTypeString(paramInfo.Type));
            }
            string[]  types    = (string[])alist.ToArray(typeof(string));
            ArrayList retalist = new ArrayList();

            retalist.Add(types);
            Array retarray = retalist.ToArray(typeof(string[]));

            return(retarray);
        }
All Usage Examples Of CookComputing.XmlRpc.XmlRpcServiceInfo::GetMethod