//- $ScanMethods -//
 private static void ScanMethods(Type type, DojoServiceDescription desc)
 {
     foreach (MethodInfo method in type.GetMethods())
     {
         Object[] os = method.GetCustomAttributes(typeof(DojoOperationAttribute), false);
         if (os.Length > 0)
         {
             DojoServiceDescriptionMethod m = new DojoServiceDescriptionMethod(method.Name);
             SearchAttributes(os, m);
             desc.MethodList.Add(m);
         }
     }
     desc.ServiceType = "JSON-RPC";
 }
 //- $SearchAttributes -//
 private static void SearchAttributes(Object[] os, DojoServiceDescriptionMethod m)
 {
     DojoOperationAttribute doa = null;
     foreach (Object o in os)
     {
         if (o is DojoOperationAttribute)
         {
             doa = (DojoOperationAttribute)o;
             break;
         }
     }
     //+
     m.ParameterList.Add(new DojoServiceDescriptionMethodParameter(doa.Name));
 }
 //- $ScanMethods -//
 private static void ScanMethods(Type type, DojoServiceDescription desc)
 {
     foreach (MethodInfo method in type.GetMethods())
     {
         Object[] os = method.GetCustomAttributes(typeof(DojoOperationAttribute), false);
         if (os.Length > 0)
         {
             DojoServiceDescriptionMethod m = new DojoServiceDescriptionMethod(method.Name);
             SearchAttributes(os, m);
             desc.MethodList.Add(m);
         }
     }
     desc.ServiceType = "JSON-RPC";
 }
        //- $SearchAttributes -//
        private static void SearchAttributes(Object[] os, DojoServiceDescriptionMethod m)
        {
            DojoOperationAttribute doa = null;

            foreach (Object o in os)
            {
                if (o is DojoOperationAttribute)
                {
                    doa = (DojoOperationAttribute)o;
                    break;
                }
            }
            //+
            m.ParameterList.Add(new DojoServiceDescriptionMethodParameter(doa.Name));
        }
Пример #5
0
 //- ~CreateDescription -//
 internal static DojoServiceDescription CreateDescription(Type type, String url)
 {
     DojoServiceDescription desc = new DojoServiceDescription();
     desc.ServiceURL = url.Substring(0, url.Length - 4);
     MethodCatalog mc = ReflectionCache.GetSpecificMethodCatalog(type.FullName);
     foreach (String m in mc.Keys)
     {
         DojoServiceDescriptionMethod dm = new DojoServiceDescriptionMethod(m);
         foreach (String p in mc[m].Parameters.Keys)
         {
             dm.ParameterList.Add(new DojoServiceDescriptionMethodParameter(p));
         }
         desc.MethodList.Add(dm);
     }
     //+
     return desc;
 }
Пример #6
0
        //- ~CreateDescription -//
        internal static DojoServiceDescription CreateDescription(Type type, String url)
        {
            DojoServiceDescription desc = new DojoServiceDescription();

            desc.ServiceURL = url.Substring(0, url.Length - 4);
            MethodCatalog mc = ReflectionCache.GetSpecificMethodCatalog(type.FullName);

            foreach (String m in mc.Keys)
            {
                DojoServiceDescriptionMethod dm = new DojoServiceDescriptionMethod(m);
                foreach (String p in mc[m].Parameters.Keys)
                {
                    dm.ParameterList.Add(new DojoServiceDescriptionMethodParameter(p));
                }
                desc.MethodList.Add(dm);
            }
            //+
            return(desc);
        }