internal void CheckNotifyEnd(CommandStatus status, Exception ex, List <NotifyItem> tables) { if (status == CommandStatus.Succeed) { NotifyItems.AddRange(tables); } }
/// <summary> /// 加入实体 /// </summary> /// <param name="api"></param> public void Add(NotifyItem api) { api.Parent = this; if (!NotifyItems.Contains(api)) { NotifyItems.Add(api); } }
/// <summary> /// 重置全局对象 /// </summary> public static void ResetGloblaCollection() { Entities.Clear(); Projects.Clear(); Enums.Clear(); TypedefItems.Clear(); NotifyItems.Clear(); ApiItems.Clear(); foreach (var solution in Solutions) { var model = new SolutionModel { Solution = solution }; model.OnSolutionLoad(); } }
/// <summary> /// 载入处理 /// </summary> public void OnSolutionLoad() { if (!Solutions.Contains(Solution)) { Solutions.Add(Solution); } Entities.AddRange(Solution.Entities); Projects.AddRange(Solution.Projects); Enums.AddRange(Solution.Enums); TypedefItems.AddRange(Solution.TypedefItems); NotifyItems.AddRange(Solution.NotifyItems); ApiItems.AddRange(Solution.ApiItems); Solution.Entities.CollectionChanged += (s, e) => CollectionChanged(Entities, e); Solution.Projects.CollectionChanged += (s, e) => CollectionChanged(Projects, e); Solution.Enums.CollectionChanged += (s, e) => CollectionChanged(Projects, e); Solution.TypedefItems.CollectionChanged += (s, e) => CollectionChanged(TypedefItems, e); Solution.ApiItems.CollectionChanged += (s, e) => CollectionChanged(Projects, e); Solution.NotifyItems.CollectionChanged += (s, e) => CollectionChanged(Projects, e); }
/// <summary> /// 加入实体 /// </summary> /// <param name="api"></param> public void Remove(NotifyItem api) { api.Parent = this; NotifyItems.Remove(api); }
public void End() { Solution.NotifyItems.Clear(); Solution.NotifyItems.AddRange(NotifyItems); NotifyItems.Clear(); }
/// <summary> /// 查找通知对象 /// </summary> /// <param name="func"></param> /// <returns></returns> public static NotifyItem GetNotify(Func <NotifyItem, bool> func) { return(NotifyItems.FirstOrDefault(func)); }