protected override void OnLoadData() { if (IsInDesignMode || string.IsNullOrEmpty(Settings.ApiKey)) { return; } var rester = new Api.Rest.Transfers(Settings.ApiKey); var transaction = ProgressTracker.StartNewTransaction(); rester.ListTransfers(response => { Transfers = response.Data.ToModelList(Invoker).OrderBy(x => x.Transfer.Name).ToObservableCollection(); if (Updater != null) { Updater.Dispose(); } //Automatically refreshes...every so often Updater = new AutonomousUpdater(Transfers, Settings, Invoker); ProgressTracker.CompleteTransaction(transaction); }); }
public void ListTransfers() { var rester = new Api.Rest.Transfers("**Put.io API Key**"); rester.ListTransfers(response => { Assert.IsNotNull(response); Assert.IsNotNull(response.Data); Assert.IsNotNull(response.Data.Transfers); Assert.IsTrue(response.Data.SafeToContinue()); EnqueueTestComplete(); }); }
private void Tick() { Thread.Sleep(_sleep); if (_disposed) return; var rest = new Api.Rest.Transfers(Settings.ApiKey); rest.ListTransfers(response => { if (response.Data == null) return; MergeTransfers(response.Data); Tick(); }); }
protected override void OnLoadData() { if (IsInDesignMode || string.IsNullOrEmpty(Settings.ApiKey)) return; var rester = new Api.Rest.Transfers(Settings.ApiKey); var transaction = ProgressTracker.StartNewTransaction(); rester.ListTransfers(response => { Transfers = response.Data.ToModelList(Invoker).OrderBy(x => x.Transfer.Name).ToObservableCollection(); if (Updater != null) Updater.Dispose(); //Automatically refreshes...every so often Updater = new AutonomousUpdater(Transfers, Settings, Invoker); ProgressTracker.CompleteTransaction(transaction); }); }
private void Tick() { Thread.Sleep(_sleep); if (_disposed) { return; } var rest = new Api.Rest.Transfers(Settings.ApiKey); rest.ListTransfers(response => { if (response.Data == null) { return; } MergeTransfers(response.Data); Tick(); }); }