/// <summary> /// Initializes a new instance of the <see cref="IssuesSearchViewModel" /> class. /// </summary> /// <param name="searchModel">The search model.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restService">The rest service.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public IssuesSearchViewModel( IssuesSearchModel searchModel, INotificationManager notificationManager, IConfigurationHelper configurationHelper, ISonarRestService restService, ISQKeyTranslator translator, ISonarLocalAnalyser analyser, IList <IIssueTrackerPlugin> plugins) { this.restService = restService; this.notificationManager = notificationManager; this.configurationHelper = configurationHelper; this.searchModel = searchModel; this.Header = "Issues Search"; this.AvailableProjects = new List <Resource>(); this.AssigneeList = new ObservableCollection <User>(); this.AvailableSearches = new ObservableCollection <string>(); this.IssuesGridView = new IssueGridViewModel("SearchView", false, configurationHelper, restService, notificationManager, translator); this.savedSearchModel = new SearchModel(this.AvailableSearches); this.IssuesGridView.ContextMenuItems = this.CreateRowContextMenu(restService, translator, analyser, plugins); this.IssuesGridView.ShowContextMenu = true; this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout; this.SizeOfFlyout = 0; this.InitCommanding(); this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; this.CreatedBeforeDate = DateTime.Now; this.CreatedSinceDate = DateTime.Now; SonarQubeViewModel.RegisterNewViewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="LocalViewModel" /> class. /// </summary> /// <param name="pluginsIn">The plugins in. TODO they must be also updatetable</param> /// <param name="service">The service.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="translator">The translator.</param> public LocalViewModel( List <IAnalysisPlugin> pluginsIn, ISonarRestService service, IConfigurationHelper configurationHelper, INotificationManager notificationManager, ISQKeyTranslator translator) { this.keyTranslator = translator; this.notificationManager = notificationManager; this.restService = service; this.configurationHelper = configurationHelper; this.plugins = pluginsIn; this.Header = "Local Analysis"; this.IssuesGridView = new IssueGridViewModel(false, "LocalView", false, this.configurationHelper, service, notificationManager, translator); this.OuputLogLines = new PaginatedObservableCollection <string>(300); this.AllLog = new List <string>(); this.InitCommanding(); this.InitFileAnalysis(); this.localAnalyserModule = new SonarLocalAnalyser(this.plugins, this.restService, this.configurationHelper, this.notificationManager); this.localAnalyserModule.StdOutEvent += this.UpdateOutputMessagesFromPlugin; this.localAnalyserModule.LocalAnalysisCompleted += this.UpdateLocalIssues; this.localAnalyserModule.AssociateCommandCompeted += this.UpdateAssociateCommand; this.ShowFlyouts = false; this.SizeOfFlyout = 0; this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; // register model AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="ServerViewModel" /> class. /// </summary> /// <param name="vsenvironmenthelper">The vsenvironmenthelper.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restservice">The restservice.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public ServerViewModel( IVsEnvironmentHelper vsenvironmenthelper, IConfigurationHelper configurationHelper, ISonarRestService restservice, INotificationManager notificationManager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser, IList <IIssueTrackerPlugin> issuetracketplugins) { this.analyser = analyser; this.notificationMan = notificationManager; this.vsenvironmenthelper = vsenvironmenthelper; this.configurationHelper = configurationHelper; this.restservice = restservice; this.Header = "Server Analysis"; this.AlreadyOpenDiffs = new SortedSet <string>(); this.IssuesGridView = new IssueGridViewModel("ServerView", true, this.configurationHelper, this.restservice, this.notificationMan, translator); this.IssuesGridView.ContextMenuItems = this.CreateRowContextMenu(restservice, translator, issuetracketplugins); this.IssuesGridView.ShowContextMenu = true; this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout; this.InitCommanding(); this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; this.SizeOfFlyout = 0; // register model AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="SourceControlMenu" /> class. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> public SetExclusionsMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { this.analyser = analyser; this.rest = rest; this.model = model; this.manager = manager; this.tranlator = translator; this.ExecuteCommand = new RelayCommand(this.OnSetExclusionsMenuCommand); this.SubItems = new ObservableCollection<IMenuItem>(); // register menu for data sync AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="SourceControlMenu" /> class. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> public SetSqaleMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { this.analyser = analyser; this.rest = rest; this.model = model; this.manager = manager; this.tranlator = translator; this.ExecuteCommand = new RelayCommand(this.OnSetExclusionsMenuCommand); this.SubItems = new ObservableCollection <IMenuItem>(); // register menu for data sync AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="IssuesSearchModel" /> class. /// </summary> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restService">The rest service.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public IssuesSearchModel( IConfigurationHelper configurationHelper, ISonarRestService restService, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser, IList <IIssueTrackerPlugin> issuetrackerplugins) { this.keyTranslator = translator; this.notificationmanager = manager; this.configurationHelper = configurationHelper; this.restService = restService; this.issuesSearchViewModel = new IssuesSearchViewModel(this, manager, this.configurationHelper, restService, translator, analyser, issuetrackerplugins); this.restSourceModel = new RestSourceControlModel(manager, restService); AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="AssociationModel" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="service">The service.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="translator">The translator.</param> /// <param name="pluginManager">The plugin manager.</param> /// <param name="model">The </param> public AssociationModel( INotificationManager logger, ISonarRestService service, IConfigurationHelper configurationHelper, ISQKeyTranslator translator, IPluginManager pluginManager, SonarQubeViewModel model, ISonarLocalAnalyser localAnalyeser, string vsVersion) { this.vsVersion = vsVersion; this.keyTranslator = translator; this.pluginManager = pluginManager; this.model = model; this.configurationHelper = configurationHelper; this.logger = logger; this.sonarService = service; this.localAnalyserModule = localAnalyeser; this.localAnalyserModule.AssociateCommandCompeted += this.LocalAssociationCompleted; }
/// <summary> /// Initializes a new instance of the <see cref="IssuesSearchViewModel" /> class. /// </summary> /// <param name="searchModel">The search model.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restService">The rest service.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public IssuesSearchViewModel( IssuesSearchModel searchModel, INotificationManager notificationManager, IConfigurationHelper configurationHelper, ISonarRestService restService, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { this.restService = restService; this.notificationManager = notificationManager; this.configurationHelper = configurationHelper; this.searchModel = searchModel; this.Header = "Issues Search"; this.AvailableProjects = new List<Resource>(); this.AssigneeList = new ObservableCollection<User>(); this.AvailableSearches = new ObservableCollection<string>(); this.IssuesGridView = new IssueGridViewModel("SearchView", false, configurationHelper, restService, notificationManager, translator); this.savedSearchModel = new SearchModel(this.AvailableSearches); this.IssuesGridView.ContextMenuItems = this.CreateRowContextMenu(restService, translator, analyser); this.IssuesGridView.ShowContextMenu = true; this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout; this.SizeOfFlyout = 0; this.InitCommanding(); this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; this.CreatedBeforeDate = DateTime.Now; this.CreatedSinceDate = DateTime.Now; SonarQubeViewModel.RegisterNewViewModelInPool(this); }
/// <summary> /// The create row context menu. /// </summary> /// <param name="service">The service.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> /// <returns> /// The /// <see><cref>ObservableCollection</cref></see> /// . /// </returns> private ObservableCollection<IMenuItem> CreateRowContextMenu(ISonarRestService service, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var menu = new ObservableCollection<IMenuItem> { ChangeStatusMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), OpenResourceMenu.MakeMenu(service, this.IssuesGridView), SourceControlMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator), IssueTrackerMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator), AssignMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), AssignTagMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), SetSqaleMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, analyser) }; return menu; }
/// <summary> /// Initializes a new instance of the <see cref="IssuesSearchModel" /> class. /// </summary> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restService">The rest service.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public IssuesSearchModel( IConfigurationHelper configurationHelper, ISonarRestService restService, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { this.keyTranslator = translator; this.notificationmanager = manager; this.configurationHelper = configurationHelper; this.restService = restService; this.issuesSearchViewModel = new IssuesSearchViewModel(this, manager, this.configurationHelper, restService, translator, analyser); this.restSourceModel = new RestSourceControlModel(manager, restService); AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="AssociationModel" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="service">The service.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="translator">The translator.</param> /// <param name="pluginManager">The plugin manager.</param> /// <param name="model">The </param> public AssociationModel( INotificationManager logger, ISonarRestService service, IConfigurationHelper configurationHelper, ISQKeyTranslator translator, IPluginManager pluginManager, SonarQubeViewModel model, ISonarLocalAnalyser localAnalyeser, string vsVersion) { this.vsVersion = vsVersion; this.keyTranslator = translator; this.pluginManager = pluginManager; this.model = model; this.configurationHelper = configurationHelper; this.logger = logger; this.sonarService = service; this.localAnalyserModule = localAnalyeser; this.localAnalyserModule.AssociateCommandCompeted += this.LocalAssociationCompleted; }
/// <summary> /// Initializes a new instance of the <see cref="SonarQubeViewModel" /> class. /// </summary> /// <param name="vsverionIn">The vsverion in.</param> /// <param name="helper">The helper.</param> /// <param name="notification">The notification.</param> /// <param name="translator">The translator.</param> /// <param name="restService">The rest service.</param> /// <param name="sourceControl">The source control.</param> /// <param name="pluginManager">The plugin manager.</param> /// <param name="locaAnalyser">The local analyser.</param> public SonarQubeViewModel( string vsverionIn, IConfigurationHelper helper, INotificationManager notification, ISQKeyTranslator translator, ISonarRestService restService, ISourceControlProvider sourceControl = null, IPluginManager pluginManager = null, ISonarLocalAnalyser locaAnalyser = null) { this.vsversion = vsverionIn; this.ToolsProvidedByPlugins = new ObservableCollection<MenuItem>(); this.AvailableProjects = new ObservableCollection<Resource>(); this.pluginManager = pluginManager; this.sourceControl = sourceControl; this.configurationHelper = helper; this.notificationManager = notification; this.sonarKeyTranslator = translator; this.sonarRestConnector = restService; this.LocaAnalyser = locaAnalyser; this.VSonarQubeOptionsViewData = new VSonarQubeOptionsViewModel( this.sonarRestConnector, this.configurationHelper, this.notificationManager); this.VSonarQubeOptionsViewData.ResetUserData(); // start association module after all models are started this.AssociationModule = new AssociationModel( this.notificationManager, this.sonarRestConnector, this.configurationHelper, this.sonarKeyTranslator, this.pluginManager, this, this.LocaAnalyser, this.vsversion); this.CanConnectEnabled = true; this.ConnectionTooltip = "Not Connected"; this.BackGroundColor = Colors.White; this.ForeGroundColor = Colors.Black; this.ErrorIsFound = true; this.IsExtensionBusy = false; this.InitCommands(); }
/// <summary> /// The create row context menu. /// </summary> /// <param name="service">The service.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> /// <returns> /// The /// <see><cref>ObservableCollection</cref></see> /// . /// </returns> private ObservableCollection <IMenuItem> CreateRowContextMenu(ISonarRestService service, ISQKeyTranslator translator, ISonarLocalAnalyser analyser, IList <IIssueTrackerPlugin> plugins) { var menu = new ObservableCollection <IMenuItem> { ChangeStatusMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), OpenResourceMenu.MakeMenu(service, this.IssuesGridView), SourceControlMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator), IssueTrackerMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, plugins), AssignMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), AssignTagMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager), SetSqaleMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, analyser) }; return(menu); }
/// <summary> /// The make menu. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <returns> /// The <see cref="IMenuItem" />. /// </returns> public static IMenuItem MakeMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var topLel = new SetSqaleMenu(rest, model, manager, translator, analyser) { CommandText = "Sqale", IsEnabled = false }; topLel.SubItems.Add(new SetSqaleMenu(rest, model, manager, translator, analyser) { CommandText = "adjust effort", IsEnabled = true }); return topLel; }
/// <summary> /// The make menu. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <returns> /// The <see cref="IMenuItem" />. /// </returns> public static IMenuItem MakeMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var topLel = new MoreInfoMenu(rest, model, manager, translator, analyser) { CommandText = "More Info", IsEnabled = true }; return(topLel); }
/// <summary> /// Initializes a new instance of the <see cref="LocalViewModel" /> class. /// </summary> /// <param name="pluginsIn">The plugins in. TODO they must be also updatetable</param> /// <param name="service">The service.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="translator">The translator.</param> public LocalViewModel( List<IAnalysisPlugin> pluginsIn, ISonarRestService service, IConfigurationHelper configurationHelper, INotificationManager notificationManager, ISQKeyTranslator translator) { this.keyTranslator = translator; this.notificationManager = notificationManager; this.restService = service; this.configurationHelper = configurationHelper; this.plugins = pluginsIn; this.Header = "Local Analysis"; this.IssuesGridView = new IssueGridViewModel(false, "LocalView", false, this.configurationHelper, service, notificationManager, translator); this.OuputLogLines = new PaginatedObservableCollection<string>(300); this.AllLog = new List<string>(); this.InitCommanding(); this.InitFileAnalysis(); this.localAnalyserModule = new SonarLocalAnalyser(this.plugins, this.restService, this.configurationHelper, this.notificationManager); this.localAnalyserModule.StdOutEvent += this.UpdateOutputMessagesFromPlugin; this.localAnalyserModule.LocalAnalysisCompleted += this.UpdateLocalIssues; this.localAnalyserModule.AssociateCommandCompeted += this.UpdateAssociateCommand; this.ShowFlyouts = false; this.SizeOfFlyout = 0; this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; // register model AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// The make menu. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <returns> /// The <see cref="IMenuItem" />. /// </returns> public static IMenuItem MakeMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var topLel = new MoreInfoMenu(rest, model, manager, translator, analyser) { CommandText = "More Info", IsEnabled = true }; return topLel; }
/// <summary> /// The make menu. /// </summary> /// <param name="rest">The rest.</param> /// <param name="model">The model.</param> /// <param name="manager">The manager.</param> /// <param name="translator">The translator.</param> /// <returns> /// The <see cref="IMenuItem" />. /// </returns> public static IMenuItem MakeMenu(ISonarRestService rest, IssueGridViewModel model, INotificationManager manager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var topLel = new SetSqaleMenu(rest, model, manager, translator, analyser) { CommandText = "Sqale", IsEnabled = false }; topLel.SubItems.Add(new SetSqaleMenu(rest, model, manager, translator, analyser) { CommandText = "adjust effort", IsEnabled = true }); return(topLel); }
/// <summary> /// The create row context menu. /// </summary> /// <param name="service">The service.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> /// <returns> /// The /// <see><cref>ObservableCollection</cref></see> /// . /// </returns> private ObservableCollection<IMenuItem> CreateRowContextMenu(ISonarRestService service, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { var menu = new ObservableCollection<IMenuItem> { SetExclusionsMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, analyser), SetSqaleMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, analyser), MoreInfoMenu.MakeMenu(service, this.IssuesGridView, this.notificationManager, translator, analyser) }; return menu; }
/// <summary> /// Initializes a new instance of the <see cref="LocalViewModel" /> class. /// </summary> /// <param name="pluginsIn">The plugin data.</param> /// <param name="service">The service.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyzer.</param> /// <param name="newIssuesList">The new issues list.</param> public LocalViewModel( IList<IAnalysisPlugin> pluginsIn, ISonarRestService service, IConfigurationHelper configurationHelper, INotificationManager notificationManager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser, Dictionary<string, List<Issue>> newIssuesList) { this.newAddedIssues = newIssuesList; this.keyTranslator = translator; this.notificationManager = notificationManager; this.restService = service; this.configurationHelper = configurationHelper; this.plugins = pluginsIn; this.Header = "Local Analysis"; this.IssuesGridView = new IssueGridViewModel("LocalView", false, this.configurationHelper, service, notificationManager, translator); this.IssuesGridView.ContextMenuItems = this.CreateRowContextMenu(service, translator, analyser); this.IssuesGridView.ShowContextMenu = true; this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout; this.AllLog = new List<string>(); this.InitCommanding(); this.localAnalyserModule = analyser; this.localAnalyserModule.StdOutEvent += this.UpdateOutputMessagesFromPlugin; this.localAnalyserModule.LocalAnalysisCompleted += this.UpdateLocalIssues; this.ShowLeftFlyOut = false; this.SizeOfFlyout = 0; this.ShowFalsePositivesAndResolvedIssues = true; this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; this.ReloadSavedOptions(this.configurationHelper); // register model AssociationModel.RegisterNewModelInPool(this); }
/// <summary> /// Initializes a new instance of the <see cref="ServerViewModel" /> class. /// </summary> /// <param name="vsenvironmenthelper">The vsenvironmenthelper.</param> /// <param name="configurationHelper">The configuration helper.</param> /// <param name="restservice">The restservice.</param> /// <param name="notificationManager">The notification manager.</param> /// <param name="translator">The translator.</param> /// <param name="analyser">The analyser.</param> public ServerViewModel( IVsEnvironmentHelper vsenvironmenthelper, IConfigurationHelper configurationHelper, ISonarRestService restservice, INotificationManager notificationManager, ISQKeyTranslator translator, ISonarLocalAnalyser analyser) { this.analyser = analyser; this.notificationMan = notificationManager; this.vsenvironmenthelper = vsenvironmenthelper; this.configurationHelper = configurationHelper; this.restservice = restservice; this.Header = "Server Analysis"; this.AlreadyOpenDiffs = new SortedSet<string>(); this.IssuesGridView = new IssueGridViewModel("ServerView", true, this.configurationHelper, this.restservice, this.notificationMan, translator); this.IssuesGridView.ContextMenuItems = this.CreateRowContextMenu(restservice, translator); this.IssuesGridView.ShowContextMenu = true; this.IssuesGridView.ShowLeftFlyoutEvent += this.ShowHideLeftFlyout; this.InitCommanding(); this.ForeGroundColor = Colors.Black; this.BackGroundColor = Colors.White; this.SizeOfFlyout = 0; // register model AssociationModel.RegisterNewModelInPool(this); }