public Task GetTaskForMethod(MethodInfo methodInfo) { foreach(Task t in Tasks) { if (t.Method != null && t.Method.Name == methodInfo.Name) { return t; } } return null; }