예제 #1
0
            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();
                }
            }
예제 #2
0
        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;
            }
        }
            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();
                }
            }
예제 #4
0
        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;
            }
        }