示例#1
0
 //- @AddMethodToCatalog -//
 public static void AddMethodToCatalog(String type, String name, Method method)
 {
     if (!MethodCatalog.ContainsKey(type))
     {
         MethodCatalog.Add(type, new MethodCatalog());
     }
     MethodCatalog[type].Add(name, method);
 }
示例#2
0
 //- ~MatchProperties -//
 internal static Object[] MatchProperties(Method method, String[] values)
 {
     List<Object> p = new List<Object>();
     if (method.Parameters.Count != values.Length)
     {
         throw new DojoRpcException("Invalid number of parameters");
     }
     Int32 i = 0;
     foreach (String key in method.Parameters.Keys)
     {
         Object val = GetValue(key, method.Parameters[key], values[i]);
         p.Add(val);
         i++;
     }
     //+
     return p.ToArray();
 }
示例#3
0
 //- ~SetMappedMethods -//
 internal static void SetMappedMethods(Type type)
 {
     foreach (MethodInfo m in type.GetMethods())
     {
         DojoOperationAttribute[] doa = (DojoOperationAttribute[])Attribute.GetCustomAttributes(m, typeof(DojoOperationAttribute), false);
         if (doa != null && doa.Length > 0)
         {
             Method md = new Method(m.Name);
             md.MethodInfo = m;
             ParameterInfo[] ps = m.GetParameters();
             if (ps != null && ps.Length > 0)
             {
                 foreach (ParameterInfo p in ps)
                 {
                     md.Parameters.Add(p.Name, p.ParameterType.Name);
                 }
             }
             ReflectionCache.AddMethodToCatalog(type.FullName, doa[0].Name, md);
         }
     }
 }