Esempio n. 1
0
        private void CreateCommands()
        {
            GenerateReportFromStrategy = new RelayCommand <IList>(GenReportFromStrategy);
            GenerateReportFromTags     = new RelayCommand <IList>(GenReportFromTags);
            GenerateReportFromTrades   = new RelayCommand <IList>(GenReportFromTrades);

            LoadStatementFromWeb = new RelayCommand <string>(async x =>
            {
                await StatementHandler.LoadFromWeb(x);
                RefreshCurrentPage();
            });
            LoadStatementFromFile = new RelayCommand <string>(async x =>
            {
                await StatementHandler.LoadFromFile(x);
                RefreshCurrentPage();
            });
        }
Esempio n. 2
0
        private void CreateCommands()
        {
            GenerateReportFromStrategy = new RelayCommand <IList>(GenReportFromStrategy);
            GenerateReportFromTags     = new RelayCommand <IList>(GenReportFromTags);
            GenerateReportFromTrades   = new RelayCommand <IList>(GenReportFromTrades);

            LoadStatementFromWeb = new RelayCommand <string>(async x =>
            {
                await StatementHandler.LoadFromWeb(x).ConfigureAwait(true);
                PostStatementLoadProcedures();
            });
            LoadStatementFromFile = new RelayCommand <string>(async x =>
            {
                await StatementHandler.LoadFromFile(x).ConfigureAwait(true);
                PostStatementLoadProcedures();
            });
        }
Esempio n. 3
0
        private void CreateCommands()
        {
            GenerateReportFromStrategy = new RelayCommand <IList>(GenReportFromStrategy);
            GenerateReportFromTags     = new RelayCommand <IList>(GenReportFromTags);
            GenerateReportFromTrades   = new RelayCommand <IList>(GenReportFromTrades);

            LoadStatementFromWeb = ReactiveCommand.CreateFromTask <string>(async x =>
            {
                var progressDialog = await DialogService.ShowProgressAsync(this, "Load Statement from Web", "Downloading").ConfigureAwait(false);
                var newData        = await StatementHandler.LoadFromWeb(x, progressDialog);
                if (newData == null)
                {
                    await progressDialog.CloseAsync();
                    return;
                }

                await PostStatementLoadProcedures(newData, progressDialog);
            });
            LoadStatementFromFile = ReactiveCommand.CreateFromTask <string>(async x =>
            {
                var progressDialog = await DialogService.ShowProgressAsync(this, "Load Statement from File", "Opening File");
                var newData        = await StatementHandler.LoadFromFile(x, progressDialog);
                if (newData == null)
                {
                    await progressDialog.CloseAsync();
                    return;
                }

                await PostStatementLoadProcedures(newData, progressDialog);
            });

            LoadStatementFromFile.ThrownExceptions.Subscribe(ex =>
            {
                _logger.Error(ex, "Error on file load");
                DialogService.ShowMessageAsync(this, "Error", ex.Message);
            });
        }