public ProgressUpdater(OneFileTransferViewModel fileTransferViewModel) { _fileTransferViewModel = fileTransferViewModel; _fileTransferViewModel.PropertyChanged += StateChangedHandler; _progressDispatcherTimer = new DispatcherTimer(); _progressDispatcherTimer.Tick += ProgressDispatcherTimerTickHandler; _progressDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 250); if (_fileTransferViewModel.State == FileTransferState.Uploading || _fileTransferViewModel.State == FileTransferState.Downloading) { _progressDispatcherTimer.Start(); } }
private void AddTransfer(OneFileTransferModel fileTransferModel) { var fileTransferViewModel = new OneFileTransferViewModel(this, fileTransferModel); if (Transfers.Contains(fileTransferViewModel)) { return; } Transfers.Add(fileTransferViewModel); if (VisualStates.BlockState == FileTransfersVisualStates.TransfersBlockState.Invisible) { VisualStates.BlockState = FileTransfersVisualStates.TransfersBlockState.Open; } }
private void AddTransfer(OneFileTransferModel fileTransferModel) { var fileTransferViewModel = new OneFileTransferViewModel(this, fileTransferModel); if (Transfers.Contains(fileTransferViewModel)) return; Transfers.Add(fileTransferViewModel); if (VisualStates.BlockState == FileTransfersVisualStates.TransfersBlockState.Invisible) { VisualStates.BlockState = FileTransfersVisualStates.TransfersBlockState.Open; } }