Esempio n. 1
0
 public int AddNewGroup(TransferGroup group_work)
 {
     if (Setting_UI.ExitAPP_Flag)
     {
         return(-1);
     }
     group_work.DataSource.Status = group_work.status.ToString();
     Groups.Add(group_work);
     if (group_work.change == ChangeTLV.Processing)
     {
         TLV_ud.AddObject(group_work);
     }
     else
     {
         TLV_done.AddObject(group_work);
     }
     return(Groups.IndexOf(group_work));
 }
Esempio n. 2
0
        void DoRefresh()
        {
            foreach (TransferGroup group in Groups)
            {
                switch (group.change)
                {
                case ChangeTLV.Done:
                    //foreach (var child in group.items)
                    //{
                    //    if (child.status != child.CheckChangeStatus)
                    //    {
                    //        TLV_done.RefreshObject(child);
                    //        child.CheckChangeStatus = child.status;
                    //    }
                    //}
                    TLV_done.RefreshObject(group);
                    break;

                case ChangeTLV.Processing:
                    for (int i = 0; i < group.items.Count; i++)
                    {
                        if (group.items[i].status == StatusTransfer.Running | group.items[i].status != group.items[i].CheckChangeStatus)
                        {
                            TLV_ud.RefreshObject(group.items[i]);
                            group.items[i].CheckChangeStatus = group.items[i].status;
                        }
                    }
                    break;

                case ChangeTLV.DoneToProcessing:
                    TLV_done.RemoveObject(Groups[Groups.IndexOf(group)]);
                    TLV_ud.AddObject(Groups[Groups.IndexOf(group)]);
                    group.change = ChangeTLV.Processing;
                    break;

                case ChangeTLV.ProcessingToDone:
                    TLV_ud.RemoveObject(Groups[Groups.IndexOf(group)]);
                    TLV_done.AddObject(Groups[Groups.IndexOf(group)]);
                    group.change = ChangeTLV.Done;
                    break;
                }
            }
        }