コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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>
        public IssuesSearchViewModel(
            IssuesSearchModel searchModel,
            INotificationManager notificationManager,
            IConfigurationHelper configurationHelper,
            ISonarRestService restService,
            ISQKeyTranslator translator)
        {
            this.notificationManager = notificationManager;
            this.configurationHelper = configurationHelper;
            this.searchModel         = searchModel;
            this.Header = "Issues Search";
            this.AvailableActionPlans = new ObservableCollection <SonarActionPlan>();
            this.UsersList            = new ObservableCollection <User>();
            this.IssuesGridView       = new IssueGridViewModel(true, "SearchView", false, configurationHelper, restService, notificationManager, translator);
            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);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginManagerModel" /> class.
        /// </summary>
        /// <param name="controller">The controller.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notifyManager">The notify manager.</param>
        /// <param name="helper">The helper.</param>
        public PluginManagerModel(
            IPluginController controller,
            IConfigurationHelper configurationHelper,
            INotificationManager notifyManager,
            IVsEnvironmentHelper helper)
        {
            this.notificationManager = notifyManager;
            this.Header = "Plugin Manager";
            this.configurationHelper   = configurationHelper;
            this.controller            = controller;
            this.vshelper              = helper;
            this.userPluginInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "vssonarextension", vshelper.VsVersion(), "plugins");

            if (!Directory.Exists(this.userPluginInstallPath))
            {
                Directory.CreateDirectory(this.userPluginInstallPath);
            }

            this.plugins = new List <IPlugin>();

            this.MenuPlugins         = new List <IMenuCommandPlugin>();
            this.AnalysisPlugins     = new List <IAnalysisPlugin>();
            this.SourceCodePlugins   = new List <ISourceVersionPlugin>();
            this.IssueTrackerPlugins = new List <IIssueTrackerPlugin>();

            var defaultPluginsFolder = Path.Combine(this.controller.ExtensionFolder, "plugins");

            this.InitPluginList(helper, null, defaultPluginsFolder);
            this.InitPluginList(helper, null, this.userPluginInstallPath);
            this.InitCommanding();

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LicenseViewerViewModel" /> class.
        /// </summary>
        /// <param name="plugincontroller">The plugincontroller.</param>
        /// <param name="helper">The helper.</param>
        public LicenseViewerViewModel(
            PluginManagerModel plugincontroller,
            IConfigurationHelper helper)
        {
            this.Header      = "License Manager";
            this.pluginModel = plugincontroller;
            this.confHelper  = helper;

            this.ForeGroundColor      = Colors.Black;
            this.ForeGroundColor      = Colors.Black;
            this.AvailableLicenses    = new ObservableCollection <VsLicense>();
            this.RefreshCommand       = new RelayCommand(this.GetLicensesFromServer);
            this.GenerateTokenCommand = new RelayCommand(this.OnGenerateTokenCommand, () => this.SelectedLicense != null);

            try
            {
                this.GetLicensesFromServer();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            // register model so it can be updated
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GeneralConfigurationViewModel" /> class.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        /// <param name="restService">The rest service.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notificationManager">The notification manager.</param>
        public GeneralConfigurationViewModel(
            VSonarQubeOptionsViewModel viewModel,
            ISonarRestService restService,
            IConfigurationHelper configurationHelper,
            INotificationManager notificationManager)
        {
            this.Header              = "General Settings";
            this.UserName            = string.Empty;
            this.Password            = string.Empty;
            this.viewModel           = viewModel;
            this.restService         = restService;
            this.configurationHelper = configurationHelper;
            this.notificationManager = notificationManager;

            this.ClearCacheCommand     = new RelayCommand(this.OnClearCacheCommand);
            this.TestConnectionCommand = new RelayCommand <object>(this.OnTestAndSavePassword);
            this.ClearCredentials      = new RelayCommand(this.OnClearCredentials);

            this.BackGroundColor = Colors.White;
            this.ForeGroundColor = Colors.Black;

            this.GetCredentials();
            this.ReloadDataFromDisk(null);

            // register model
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalysisOptionsViewModel" /> class.
        /// </summary>
        /// <param name="viewModel">The view Model.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        public AnalysisOptionsViewModel(
            VSonarQubeOptionsViewModel viewModel,
            IConfigurationHelper configurationHelper)
        {
            this.configurationHelper       = configurationHelper;
            this.viewModel                 = viewModel;
            this.TimeoutValue              = 10;
            this.IsSolutionAnalysisChecked = true;
            this.IsProjectAnalysisChecked  = true;
            this.Header                 = "Analysis Options";
            this.ForeGroundColor        = Colors.Black;
            this.BackGroundColor        = Colors.White;
            this.DownloadWrapperCommand = new RelayCommand(this.OnDownloadWrapperCommand);

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
            AssociationModel.RegisterNewModelInPool(this);

            try
            {
                this.ReloadDataFromDisk(null);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Failed to reload from disk : " + ex.Message);
            }
        }
コード例 #7
0
        public AssociationViewModel(AssociationModel model)
        {
            this.model = model;
            this.AssignProjectCommand = new RelayCommand(this.OnAssignProjectCommand);
            this.AvailableProjects    = new ObservableCollection <Resource>();
            this.Header = "Association Dialog";

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #8
0
        public AssociationViewModel()
        {
            this.AssignProjectCommand = new RelayCommand(this.OnAssignProjectCommand);
            this.AvailableProjects    = new ObservableCollection <Resource>();
            this.Header          = "Association Dialog";
            this.BackGroundColor = Colors.White;
            this.ForeGroundColor = Colors.Black;

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VSonarQubeOptionsViewModel" /> class.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notifier">The notifier.</param>
        public VSonarQubeOptionsViewModel(
            ISonarRestService service,
            IConfigurationHelper configurationHelper,
            INotificationManager notifier)
        {
            this.notificationManager = notifier;
            this.restService         = service;
            this.configurationHelper = configurationHelper;

            this.InitModels();
            this.InitCommanding();

            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #10
0
        public RoslynManagerViewModel(RoslynManagerModel model)
        {
            this.Header                  = "Roslyn Manager";
            this.model                   = model;
            this.BackGroundColor         = Colors.White;
            this.ForeGroundColor         = Colors.Black;
            this.AvailableDllDiagnostics = new ObservableCollection <VSSonarExtensionDiagnostic>();
            this.AvailableChecksInDll    = new ObservableCollection <RoslynDiagnosticInterpretation>();

            foreach (var item in model.ExtensionDiagnostics)
            {
                AvailableDllDiagnostics.Add(item.Value);
            }

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
コード例 #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RoslynManagerViewModel"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        public RoslynManagerViewModel(RoslynManagerModel model)
        {
            this.Header                  = "Roslyn Manager";
            this.model                   = model;
            this.BackGroundColor         = Colors.White;
            this.ForeGroundColor         = Colors.Black;
            this.AvailableDllDiagnostics = new ObservableCollection <VSSonarExtensionDiagnostic>();

            foreach (var item in model.ExtensionDiagnostics)
            {
                AvailableDllDiagnostics.Add(item.Value);
            }

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
            this.InstallNewDllCommand = new RelayCommand(this.OnInstallNewDllCommand);
            this.RemoveDllCommand     = new RelayCommand(this.OnRemoveDllCommand);
        }
コード例 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalysisOptionsViewModel" /> class.
        /// </summary>
        /// <param name="viewModel">The view Model.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        public AnalysisOptionsViewModel(
            VSonarQubeOptionsViewModel viewModel,
            IConfigurationHelper configurationHelper)
        {
            this.configurationHelper       = configurationHelper;
            this.viewModel                 = viewModel;
            this.TimeoutValue              = 10;
            this.IsSolutionAnalysisChecked = true;
            this.IsProjectAnalysisChecked  = true;
            this.Header                          = "Analysis Options";
            this.ForeGroundColor                 = Colors.Black;
            this.BackGroundColor                 = Colors.White;
            this.BrowseForJavaTrigger            = new RelayCommand(this.OnBrowseForJavaTrigger);
            this.BrowseForSonarRunnerQubeTrigger = new RelayCommand(this.OnBrowseForSonarRunnerQubeTrigger);

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
            AssociationModel.RegisterNewModelInPool(this);
        }
コード例 #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginManagerModel" /> class.
        /// </summary>
        /// <param name="controller">The controller.</param>
        /// <param name="configurationHelper">The configuration helper.</param>
        /// <param name="notifyManager">The notify manager.</param>
        /// <param name="helper">The helper.</param>
        public PluginManagerModel(
            IPluginController controller,
            IConfigurationHelper configurationHelper,
            INotificationManager notifyManager,
            IVsEnvironmentHelper helper)
        {
            this.notificationManager = notifyManager;
            this.Header = "Plugin Manager";
            this.configurationHelper = configurationHelper;
            this.controller          = controller;
            this.vshelper            = helper;

            this.plugins             = new List <IPlugin>();
            this.MenuPlugins         = new List <IMenuCommandPlugin>();
            this.AnalysisPlugins     = new List <IAnalysisPlugin>();
            this.SourceCodePlugins   = new List <ISourceVersionPlugin>();
            this.IssueTrackerPlugins = new List <IIssueTrackerPlugin>();

            this.InitPluginList(helper, null);
            this.InitCommanding();

            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }