controls the available versions in server
示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RoslynManagerModel" /> class.
        /// </summary>
        /// <param name="pluginsIn">The plugins in.</param>
        /// <param name="notificationManagerIn">The notification manager in.</param>
        /// <param name="configHelper">The configuration helper.</param>
        public RoslynManagerModel(
            IEnumerable <IAnalysisPlugin> pluginsIn,
            INotificationManager notificationManagerIn,
            IConfigurationHelper configHelper,
            ISonarRestService rest)
        {
            this.roslynHomePath             = Path.Combine(configHelper.ApplicationPath, "Diagnostics");
            this.roslynExternalUserDiagPath = Path.Combine(this.roslynHomePath, "UserDiagnostics");
            this.roslynEmbbedDiagPath       = Path.Combine(this.roslynHomePath, "InternalDiagnostics");

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

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

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

            this.rest                   = rest;
            this.confHelper             = configHelper;
            this.plugins                = pluginsIn;
            this.notificationManager    = notificationManagerIn;
            this.ExtensionDiagnostics   = new Dictionary <string, VSSonarExtensionDiagnostic>();
            this.embedVersionController = new EmbbedVersionController(this.notificationManager, rest, configHelper, this.roslynEmbbedDiagPath);

            // register model
            AssociationModel.RegisterNewModelInPool(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RoslynManagerModel" /> class.
        /// </summary>
        /// <param name="pluginsIn">The plugins in.</param>
        /// <param name="notificationManagerIn">The notification manager in.</param>
        /// <param name="configHelper">The configuration helper.</param>
        public RoslynManagerModel(
            IEnumerable<IAnalysisPlugin> pluginsIn,
            INotificationManager notificationManagerIn,
            IConfigurationHelper configHelper,
            ISonarRestService rest)
        {
            this.roslynHomePath = Path.Combine(configHelper.ApplicationPath, "Diagnostics");
            this.roslynExternalUserDiagPath = Path.Combine(this.roslynHomePath, "UserDiagnostics");
            this.roslynEmbbedDiagPath = Path.Combine(this.roslynHomePath, "InternalDiagnostics");

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

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

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

            this.rest = rest;
            this.confHelper = configHelper;
            this.plugins = pluginsIn;
            this.notificationManager = notificationManagerIn;
            this.ExtensionDiagnostics = new Dictionary<string, VSSonarExtensionDiagnostic>();
            this.embedVersionController = new EmbbedVersionController(this.notificationManager, rest, configHelper, this.roslynEmbbedDiagPath);

            // register model
            AssociationModel.RegisterNewModelInPool(this);
        }