/// <summary> /// Constructor /// </summary> /// <param name="teamExplorer">TeamExplorer VS service</param> /// <param name="issuesDataSource">SonarQube issues data source</param> /// <param name="projectPathsManager">Project paths manager</param> public ProjectViewModel(ITeamExplorer teamExplorer, SonarLinkIssueDataSource issuesDataSource, IProjectPathsManager projectPathsManager) { TeamExplorer = teamExplorer; ErrorTable = issuesDataSource; _projectPathsManager = projectPathsManager; // Bootstrap the projects view with an empty collection SonarProjects = Enumerable.Empty <SonarQubeProject>(); FolderSelectCommand = new AsyncCommand(param => OnFolderSelectAsync((SonarQubeProject)param)); ItemSelectCommand = new AsyncCommand(param => OnItemSelectAsync((SonarQubeProject)param)); }
public SonarLinkProjectPage([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, SonarLinkIssueDataSource issues, IProjectPathsManager projectPathsManager) { var service = serviceProvider.GetService(typeof(ITeamExplorer)); if (service != null) { TeamExplorer = service as ITeamExplorer; } var table = GetErrorsTable(serviceProvider); table.AddSource(issues, SonarLinkIssueDataSource.Columns); PageContent = new ProjectView() { DataContext = new ProjectViewModel(TeamExplorer, issues, projectPathsManager) }; ViewModel.ItemSelectCommand.CanExecuteChanged += ItemSelectCommand_CanExecuteChanged; }