コード例 #1
0
 public FileTransferViewItem(FileTransfer transfer)
     : this()
 {
     this.Id = transfer.Id;
     this.Session = transfer.Request.Session.SessionName;
     this.Source = ToString(transfer.Request.SourceFiles);
     this.Target = transfer.Request.TargetFile.Path;
     this.Start = DateTime.Now;
 }
コード例 #2
0
        void ProcessTransferUpdate(FileTransfer transfer)
        {
            int idx = this.ViewModel.FindIndexById(transfer.Id);
            if (idx == -1)
            {
                Log.WarnFormat("Could not notify ViewModel, id={0}", transfer.Id);
            }
            else
            {
                // update items
                FileTransferViewItem viewItem = this.ViewModel.FileTransfers[idx];
                viewItem.Progress = transfer.PercentComplete;
                viewItem.Status = transfer.TransferStatus;
                viewItem.Message = transfer.TransferStatusMsg;
                viewItem.Start = transfer.StartTime;
                viewItem.End = transfer.EndTime;
                viewItem.CanCancel = FileTransfer.CanCancel(viewItem.Status);
                viewItem.CanRestart = FileTransfer.CanRestart(viewItem.Status);
                viewItem.CanDelete = FileTransfer.CanRestart(viewItem.Status);

                // notify on update
                this.ViewModel.FileTransfers.ResetItem(idx);
            }
        }
コード例 #3
0
        void AddTransfer(FileTransfer transfer)
        {
            // store
            this.fileTranfers.Add(transfer.Id, transfer);

            // notify
            this.ViewModel.FileTransfers.Add(new FileTransferViewItem(transfer));

            // hook for updates
            transfer.Update += (transfer_Update);
        }