public PackageInfo?SelectPackage(string?searchTerm)
        {
            if (_viewModel == null)
            {
                _viewModel = ViewModelFactory.CreatePackageChooserViewModel(null);
                _viewModel.PackageDownloadRequested += OnPackageDownloadRequested;
            }

            var dialog = new PackageChooserDialog(SettingsManager, _viewModel)
            {
                Owner = Window.Value
            };

            ReCenterPackageChooserDialog(dialog);

            try
            {
                dialog.ShowDialog(searchTerm);
            }
            catch (ArgumentException e)
            {
                UIServices.Show(e.Message, MessageLevel.Error);
            }

            return(_viewModel.SelectedPackage);
        }
        public PackageInfo?SelectPluginPackage()
        {
            if (_pluginDialog == null)
            {
                _pluginViewModel = ViewModelFactory.CreatePackageChooserViewModel(NuGetConstants.PluginFeedUrl);
                _pluginDialog    = new PackageChooserDialog(SettingsManager, _pluginViewModel);
            }

            _pluginDialog.Owner = Window.Value;
            ReCenterPackageChooserDialog(_pluginDialog);
            _pluginDialog.ShowDialog();
            return(_pluginViewModel?.SelectedPackage);
        }
Пример #3
0
        public PackageInfo SelectPackage(string searchTerm)
        {
            if (_dialog == null)
            {
                _viewModel = ViewModelFactory.CreatePackageChooserViewModel(null);
                _viewModel.PackageDownloadRequested += OnPackageDownloadRequested;
                _dialog = new PackageChooserDialog(_viewModel);
            }

            _dialog.Owner = Window.Value;
            ReCenterPackageChooserDialog(_dialog);
            _dialog.ShowDialog(searchTerm);
            return(_viewModel.SelectedPackage);
        }
Пример #4
0
        public PackageInfo SelectPluginPackage()
        {
            if (_pluginDialog == null)
            {
                _pluginViewModel = ViewModelFactory.CreatePackageChooserViewModel(NuGetConstants.PluginFeedUrl);
                _pluginDialog    = new PackageChooserDialog(_pluginViewModel)
                {
                    Owner = Window.Value
                };
            }

            _pluginDialog.ShowDialog();
            return(_pluginViewModel.SelectedPackage);
        }
        public PackageInfo?SelectPackage(string?searchTerm)
        {
            if (_viewModel == null)
            {
                _viewModel = ViewModelFactory.CreatePackageChooserViewModel(null);
                _viewModel.PackageDownloadRequested += OnPackageDownloadRequested;
            }

            var dialog = new PackageChooserDialog(SettingsManager, _viewModel)
            {
                Owner = Window.Value
            };

            ReCenterPackageChooserDialog(dialog);
            dialog.ShowDialog(searchTerm);

            return(_viewModel.SelectedPackage);
        }