private static void Foreach(Action <ProjectConfig> action, SolutionConfig solution) { foreach (var project in solution.Projects) { Foreach(action, project); } }
private static void Foreach(Func <ProjectConfig, bool> condition, Action <ProjectConfig> action, SolutionConfig solution) { foreach (var project in solution.Projects) { Foreach(condition, action, project); } }
private static void Foreach(Action <ConfigBase> action, SolutionConfig solution) { DoAction(action, solution); foreach (var project in solution.Projects) { Foreach(action, project); } }
private static void Foreach(Func <ConfigBase, bool> condition, Action <ConfigBase> action, SolutionConfig solution) { DoAction(condition, action, solution); foreach (var project in solution.Projects) { Foreach(condition, action, project); } }
private static void Foreach <T>(Func <T, bool> condition, Action <T> action, SolutionConfig solution) where T : ConfigBase { int lv = level; DoAction(condition, action, solution); foreach (var project in solution.Projects) { level = lv + 1; Foreach(condition, action, project); } level = lv; }
/// <summary> /// 所有对象遍历 /// </summary> public static void ForeachAll(SolutionConfig solution, Action <ConfigBase> action) { action(solution); foreach (var project in solution.Projects) { action(project); foreach (var entity in project.Entities) { action(entity); foreach (var field in entity.Properties) { action(field); } foreach (var command in entity.Commands) { action(command); } } } foreach (var config in solution.Enums) { action(config); foreach (var item in config.Items) { action(item); } } foreach (var config in solution.TypedefItems) { action(config); foreach (var item in config.Items.Values) { action(item); } } foreach (var item in solution.TypedefItems) { action(item); } foreach (var config in solution.ApiItems) { action(config); } foreach (var config in solution.NotifyItems) { action(config); } }
/// <summary> /// 设置当前解决方案 /// </summary> /// <param name="solution"></param> public static void SetCurrentSolution(SolutionConfig solution) { SolutionConfig.SetCurrentSolution(solution); GlobalTrigger.Reset(); GlobalTrigger.OnLoad(solution); }
/// <summary> /// 设置当前解决方案 /// </summary> /// <param name="solution"></param> public static void OnSolutionLoad(SolutionConfig solution) { GlobalTrigger.OnLoad(solution); }
/// <summary> /// 设置当前解决方案 /// </summary> /// <param name="solution"></param> public static void SetCurrentSolution(SolutionConfig solution) { Current = solution; }