Exemple #1
0
        public async void SetConnectionInfo(ConnectionInfoEditorViewModel viewModel)
        {
            _options.BaselineServer   = viewModel.BaselineServer;
            _options.BaselineDatabase = viewModel.BaselineDatabase;
            _options.BaselineSchema   = viewModel.BaselineSchema;
            _options.BaselineUsername = viewModel.BaselineUsername;
            _options.BaselinePassword = viewModel.BaselinePassword;

            _options.BenchmarkServer   = viewModel.BenchmarkServer;
            _options.BenchmarkDatabase = viewModel.BenchmarkDatabase;
            _options.BenchmarkSchema   = viewModel.BenchmarkSchema;
            _options.BenchmarkUsername = viewModel.BenchmarkUsername;
            _options.BenchmarkPassword = viewModel.BenchmarkPassword;

            _invalidOptions = false;

            ShowStatusMessage("Pre InitializeAll");
            // now that the options are filled, I can invoke the initialization
            InitializeAll();
            BaseMetroDialog showingDialog = null;

            showingDialog = await _dialogCoordinator.GetCurrentDialogAsync <BaseMetroDialog>(this);

            if (showingDialog != null)
            {
                await _dialogCoordinator.HideMetroDialogAsync(this, showingDialog);
            }

            ShowStatusMessage("Post InitializeAll");
        }
Exemple #2
0
        private async void ShowConnectionInfoDialog()
        {
            var editor    = new View.ConnectionInfoDialog();
            var viewModel = new ConnectionInfoEditorViewModel()
            {
                Context = this, Dialog = editor
            };

            editor.DataContext          = viewModel;
            viewModel.BaselineServer    = _options.BaselineServer;
            viewModel.BaselineDatabase  = _options.BaselineDatabase;
            viewModel.BaselineSchema    = _options.BaselineSchema;
            viewModel.BaselineUsername  = _options.BaselineUsername;
            viewModel.BaselinePassword  = _options.BaselinePassword;
            viewModel.BenchmarkServer   = _options.BenchmarkServer;
            viewModel.BenchmarkDatabase = _options.BenchmarkDatabase;
            viewModel.BenchmarkSchema   = _options.BenchmarkSchema;
            viewModel.BenchmarkUsername = _options.BenchmarkUsername;
            viewModel.BenchmarkPassword = _options.BenchmarkPassword;
            await _dialogCoordinator.ShowMetroDialogAsync(this, editor);
        }