public override void Execute(object parameter) { if (_state.Status != ParserState.Error) { return; } var viewModel = CreateViewModel(); if (_viewModel == null) { return; } _viewModel.AddTab(viewModel); _viewModel.SelectedTab = viewModel; try { var presenter = _presenterService.Presenter(_viewModel); presenter.Show(); } catch (Exception e) { Console.WriteLine(e); } }
protected override void ExecuteImpl(object parameter) { if (_viewModel == null) { return; } try { var presenter = _presenterService.Presenter(_viewModel); presenter.Show(); } catch (Exception e) { Console.WriteLine(e); } }
protected override void OnExecute(object parameter) { if (_state.Status != ParserState.Ready) { return; } var declaration = FindTarget(parameter); if (declaration == null) { return; } var viewModel = CreateViewModel(declaration); if (!viewModel.SearchResults.Any()) { _messageBox.Show(string.Format(RubberduckUI.AllReferences_NoneFound, declaration.IdentifierName), RubberduckUI.Rubberduck, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } if (viewModel.SearchResults.Count == 1) { _navigateCommand.Execute(viewModel.SearchResults.Single().GetNavigationArgs()); return; } _viewModel.AddTab(viewModel); _viewModel.SelectedTab = viewModel; try { var presenter = _presenterService.Presenter(_viewModel); presenter.Show(); } catch (Exception e) { Logger.Error(e); } }