Exemple #1
0
        private void Init(RPCCallObject o)
        {
            Token = o;
            Type type = o.GetType();

            var methos = type.GetMethods();

            foreach (var item in methos)
            {
                if (item.IsPublic)
                {
                    string methodName = item.Name;
                    var    args       = item.GetParameters();

                    Type[] typeArg = new Type[args.Length];

                    for (int i = 0; i < args.Length; i++)
                    {
                        typeArg[i] = args[i].ParameterType;
                    }

                    methodName = Make.MakeMethodName(methodName, typeArg);
                    if (!MethodInfoDiy.ContainsKey(methodName))
                    {
                        MethodInfoDiy.Add(methodName, new MethodModuleDef(item));
                    }
                }
            }
        }
Exemple #2
0
        private void Init(RPCCallObject o)
        {
            Token = o;
            Type type = o.GetType();

            string tag = Make.GetTypeTag(type);

            if (!string.IsNullOrEmpty(tag))
            {
                ModuleName = tag;
            }


            var methos = type.GetMethods();

            foreach (var item in methos)
            {
                string _methosName;
                if (item.IsPublic)
                {
                    string methodName = item.Name;

                    if (Make.IsCallMethod(item, out _methosName))
                    {
                        if (!string.IsNullOrEmpty(_methosName))
                        {
                            methodName = _methosName;
                        }
                    }

                    var args = item.GetParameters();

                    Type[] typeArg = new Type[args.Length];

                    for (int i = 0; i < args.Length; i++)
                    {
                        typeArg[i] = args[i].ParameterType;
                    }

                    methodName = Make.MakeMethodName(methodName, typeArg);

                    if (!MethodInfoDiy.ContainsKey(methodName))
                    {
                        MethodInfoDiy.Add(methodName, new MethodModuleDef(item));
                    }
                }
            }
        }
Exemple #3
0
 public ModuleDef(RPCCallObject o)
 {
     ModuleName    = o.GetType().Name;
     MethodInfoDiy = new Dictionary <string, MethodModuleDef>();
     Init(o);
 }
Exemple #4
0
        public void RegModule(RPCCallObject o)
        {
            ModuleDef tmp = new ModuleDef(o);

            ModuleDiy.AddOrUpdate(o.GetType().Name, tmp, (a, b) => tmp);
        }