Пример #1
0
        public void Regist(Type type, object instance)
        {
            foreach (MethodInfo method in type.GetMethods())
            {
                if (method.IsSpecialName)
                {
                    continue;
                }
                Regulus.Utility.Log.Instance.WriteInfo($"method name = {method.Name} ");

                MethodStringInvoker invoker = new MethodStringInvoker(instance, method);
                AgentCommand        ac      = new AgentCommand(_VersionProvider, type, invoker);
                _Invokers.Add(ac);
                _Command.Register(ac.Name, (args) => _PrintReturn(invoker.Invoke(args)), method.ReturnParameter.ParameterType, method.GetParameters().Select((p) => p.ParameterType).ToArray());
            }
        }
Пример #2
0
 public AgentCommand(AgentCommandVersionProvider provider, System.Type type, MethodStringInvoker invoker)
 {
     Target = invoker.Target;
     Name   = $"{type.Name}-{ provider.GetVersion(type, invoker.Method)   }.{invoker.Method.Name} [{_BuildParams(invoker.Method)}]";
 }