Inheritance: IOptionsViewModelBase, IModelBase
Exemple #1
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);
        }
        /// <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);
            }
        }
        /// <summary>
        /// The refresh data context.
        /// </summary>
        /// <param name="vSonarQubeOptionsViewData">
        /// The v sonar qube options view data.
        /// </param>
        public void RefreshDataContext(VSonarQubeOptionsViewModel vSonarQubeOptionsViewData)
        {
            if (vSonarQubeOptionsViewData != null)
            {
                vSonarQubeOptionsViewData.RequestClose += (s, e) => this.Close();
            }

            this.DataContext = null;
            this.DataContext = vSonarQubeOptionsViewData;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtensionOptionsWindow"/> class.
        /// </summary>
        /// <param name="dataViewModel">
        /// The data view model.
        /// </param>
        public VSonarQubeOptionsView(VSonarQubeOptionsViewModel dataViewModel)
        {
            this.InitializeComponent();
            if (dataViewModel != null)
            {
                dataViewModel.RequestClose += (s, e) => this.Close();
            }

            this.DataContext = dataViewModel;
        }
Exemple #5
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);
        }
        /// <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.StatusMessage = "";
            this.UserName = string.Empty;
            this.Password = string.Empty;
            this.viewModel = viewModel;
            this.restService = restService;
            this.configurationHelper = configurationHelper;
            this.notificationManager = notificationManager;

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

            this.ConnectToServerCommand = new VsRelayCommand<object>(this.OnConnectToServerCommand);

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

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

            // register model
            AssociationModel.RegisterNewModelInPool(this);
            SonarQubeViewModel.RegisterNewViewModelInPool(this);
        }
        /// <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);
        }
        /// <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);
            }
        }