/// <summary> /// 添加带返回值的任务 /// </summary> /// <typeparam name="parameterType">执行参数类型</typeparam> /// <typeparam name="returnType">返回值类型</typeparam> /// <param name="func">任务执行委托</param> /// <param name="parameter">执行参数</param> /// <returns>任务添加是否成功</returns> public runReturn <parameterType, returnType> Add <parameterType, returnType>(func <parameterType, returnType> func, parameterType parameter) { if (func != null) { runReturn <parameterType, returnType> value = new runReturn <parameterType, returnType>(func, parameter); if (add(value.TaskInfo)) { return(value); } } return(null); }
/// <summary> /// 添加带返回值的任务 /// </summary> /// <typeparam name="returnType">返回值类型</typeparam> /// <param name="func">任务执行委托</param> /// <returns>任务添加是否成功</returns> public runReturn <returnType> Add <returnType>(func <returnType> func) { if (func != null) { runReturn <returnType> value = new runReturn <returnType>(func); if (add(value.TaskInfo)) { return(value); } } return(null); }