public static MethodInfo[] GetMethodsWithAttribute(Type fixtureType, Type attributeType, bool inherit) { MethodInfoList methodInfoList = new MethodInfoList(); MethodInfo[] methods = fixtureType.GetMethods(AllMembers); foreach (MethodInfo methodInfo in methods) { if (methodInfo.IsDefined(attributeType, inherit)) { methodInfoList.Add(methodInfo); } } methodInfoList.Sort(new BaseTypesFirstComparer()); return(methodInfoList.ToArray()); }
public Task <MethodResult <MethodInfoList> > GetMethods(ClientConnection clt, Empty e) { MethodInfoList l = new MethodInfoList(); l.List.AddRange(_serverMethods.Methods.Select(i => new MethodInfo() { EndPoint = i.Key, ParamPayloadType = i.Value.ParameterPayloadType, ResultPayloadType = i.Value.ResultPayloadType })); l.List.AddRange(_clientMethods.Select(kvp => new MethodInfo() { EndPoint = kvp.Key, ParamPayloadType = kvp.Value.ParamPayloadType, ResultPayloadType = kvp.Value.ResultPayloadType })); return(Task.FromResult(MethodResult <MethodInfoList> .FromResult(l))); }