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);
            });
        }
Exemplo n.º 2
0
        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();
            });
        }
Exemplo n.º 3
0
        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();
            });
        }
Exemplo n.º 4
0
        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);
            });
        }
Exemplo n.º 6
0
        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();
            });
        }