Example #1
0
        public void FileCountRefresh()
        {
            var sendingFiles  = FileChannelMessageDeal.GetAllSendingFileInfo();
            var recivingFiles = FileChannelMessageDeal.GetAllRecivingingFileInfo();

            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                CurrentSendFiles.Clear();
                CurrentRecivesFiles.Clear();

                foreach (var item in sendingFiles)
                {
                    CurrentSendFiles.Add(
                        new FragState
                    {
                        FileGuid      = item.fileGuid,
                        FileLocalName = item.fileName,
                        PersentStr    = cuteFilePercent(item)
                    });
                }

                foreach (var item in recivingFiles)
                {
                    CurrentRecivesFiles.Add(
                        new FragState
                    {
                        FileGuid      = item.fileGuid,
                        FileLocalName = item.fileGuid + "__" + item.fileName,
                        PersentStr    = cuteFilePercent(item)
                    });
                }
            }));
        }
Example #2
0
 public void FileFragRefresh(FileFragInfo fileinfo)
 {
     Application.Current.Dispatcher.BeginInvoke(new Action(() =>
     {
         var find = CurrentSendFiles.FirstOrDefault(o => o.FileGuid == fileinfo.fileGuid);
         if (find != null)
         {
             find.PersentStr = cuteFilePercent(fileinfo);
             //CurrentSendFiles = CurrentSendFiles;
         }
         find = CurrentRecivesFiles.FirstOrDefault(o => o.FileGuid == fileinfo.fileGuid);
         if (find != null)
         {
             find.PersentStr = cuteFilePercent(fileinfo);
             //CurrentSendFiles = CurrentSendFiles;
         }
     }));
 }