public SolutionBindingInformationProvider(IServiceProvider serviceProvider)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            this.serviceProvider = serviceProvider;

            ruleSetInfoProvider = this.serviceProvider.GetService <ISolutionRuleSetsInformationProvider>();
            ruleSetInfoProvider.AssertLocalServiceIsNotNull();
        }
        internal /* for testing */ UnboundProjectFinder(IServiceProvider serviceProvider, IFileSystem fileSystem)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            this.serviceProvider = serviceProvider;

            ruleSetInfoProvider = this.serviceProvider.GetService <ISolutionRuleSetsInformationProvider>();
            ruleSetInfoProvider.AssertLocalServiceIsNotNull();

            this.fileSystem = fileSystem;
        }
Exemplo n.º 3
0
        public CFamilyRuleConfigProvider(IHost host, IActiveSolutionBoundTracker activeSolutionBoundTracker, IUserSettingsProvider userSettingsProvider,
                                         ILogger logger, ICFamilyRulesConfigProvider sonarWayProvider, IFileSystem fileSystem)
        {
            this.activeSolutionBoundTracker = activeSolutionBoundTracker;
            this.userSettingsProvider       = userSettingsProvider;
            this.logger = logger;

            solutionInfoProvider = host.GetService <ISolutionRuleSetsInformationProvider>();
            solutionInfoProvider.AssertLocalServiceIsNotNull();

            this.sonarWayProvider = sonarWayProvider;
            this.serializer       = new RulesSettingsSerializer(fileSystem, logger);

            this.effectiveConfigCalculator = new EffectiveRulesConfigCalculator(logger);
        }
Exemplo n.º 4
0
        public RuleSetReferenceChecker(IServiceProvider serviceProvider, ILogger logger)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));

            ruleSetInfoProvider = serviceProvider.GetService <ISolutionRuleSetsInformationProvider>();
            ruleSetInfoProvider.AssertLocalServiceIsNotNull();

            ruleSetSerializer = serviceProvider.GetService <IRuleSetSerializer>();
            ruleSetSerializer.AssertLocalServiceIsNotNull();
        }