예제 #1
0
        public CloudDriveTransferViewModel(IEventAggregator eventAggregator,
                                           IWebDavClientService webDavClientService, ISwitchContentService switchContentService
                                           , ITransferDataService transferDataService)
        {
            this._eventAggregator      = eventAggregator;
            this._webDavClientService  = webDavClientService;
            this._switchContentService = switchContentService;
            this._transferDataService  = transferDataService;

            this.TransferInfos = new ObservableCollection <TransferInfo>(this._transferDataService.RetriveHistory());

            this.BackCommand           = new DelegateCommand(this.Back, this.CanBack);
            this.ClearCommand          = new DelegateCommand(this.Clear, this.CanClear);
            this.CancelAllCommand      = new DelegateCommand(this.CancelAll, this.CanCancelAll);
            this.NavigateItemCommand   = new DelegateCommand <TransferInfo>(this.NavigateItem, this.CanNavigateItem);
            this.CancelTransferCommand = new DelegateCommand <TransferInfo>(this.CancelTransfer, this.CanCancelTransfer);
            this._eventAggregator.GetEvent <PubSubEvent <TransferActionInfo> >().Subscribe(UploadOrDownloadAction);
            this._eventAggregator.GetEvent <PubSubEvent <EditorActionInfo> >().Subscribe(EditorAction);
            this._eventAggregator.GetEvent <WindowClosingEvent>().Subscribe(SaveTransferInfos, ThreadOption.UIThread);
        }
예제 #2
0
 public static void SetMockedImplementation(ITransferDataService implementation) =>
 _implementation = implementation;
예제 #3
0
 public static void Reset() => _implementation = new TransferDataService();