示例#1
0
        private List <OutPutInfo> CreateOutputInfos(System.Reflection.MethodInfo m)
        {
            var ret = new List <OutPutInfo>();

            if (m.ReturnType.Name != "Void")
            {
                var subSpy = SubSpyFor(m.ReturnType);
                ret.Add(new OutPutInfo()
                {
                    Type      = _genericManager.TypeGenericName(m.ReturnType, m),
                    Provision = Provision(subSpy, m.ReturnType, "ret"),
                });
            }
            foreach (var p in m.GetParameters().Where(p => p.IsOut))
            {
                var subSpy = SubSpyFor(p.ParameterType);
                ret.Add(new OutPutInfo()
                {
                    Type      = _genericManager.TypeGenericName(p.ParameterType, m),
                    Name      = p.Name,
                    Provision = Provision(subSpy, p.ParameterType, p.Name),
                });
            }
            return(ret);
        }
示例#2
0
 private List <InputInfo> CreateInputInfos(System.Reflection.MethodInfo m)
 {
     return(m.GetParameters().Where(i => !i.IsOut).Select(delegate(ParameterInfo p)
     {
         var subSpy = SubSpyFor(p.ParameterType);
         return new InputInfo()
         {
             Type = _genericManager.TypeGenericName(p.ParameterType, m),
             Name = p.Name,
             Provision = Provision(subSpy, p.ParameterType, p.Name),
         };
     }).ToList());
 }