internal void CheckNotifyEnd(CommandStatus status, Exception ex, List <NotifyItem> tables)
 {
     if (status == CommandStatus.Succeed)
     {
         NotifyItems.AddRange(tables);
     }
 }
예제 #2
0
 /// <summary>
 /// 加入实体
 /// </summary>
 /// <param name="api"></param>
 public void Add(NotifyItem api)
 {
     api.Parent = this;
     if (!NotifyItems.Contains(api))
     {
         NotifyItems.Add(api);
     }
 }
예제 #3
0
 /// <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();
     }
 }
예제 #4
0
        /// <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);
        }
예제 #5
0
 /// <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();
 }
예제 #7
0
 /// <summary>
 ///     查找通知对象
 /// </summary>
 /// <param name="func"></param>
 /// <returns></returns>
 public static NotifyItem GetNotify(Func <NotifyItem, bool> func)
 {
     return(NotifyItems.FirstOrDefault(func));
 }