예제 #1
0
        public BindingProcessImpl(IHost host,
                                  BindCommandArgs bindingArgs,
                                  ISolutionBindingOperation solutionBindingOperation,
                                  INuGetBindingOperation nugetBindingOperation,
                                  IUnboundProjectFinder unboundProjectFinder,
                                  IBindingConfigProvider bindingConfigProvider,
                                  SonarLintMode bindingMode,
                                  bool isFirstBinding = false)
        {
            this.host        = host ?? throw new ArgumentNullException(nameof(host));
            this.bindingArgs = bindingArgs ?? throw new ArgumentNullException(nameof(bindingArgs));
            this.solutionBindingOperation = solutionBindingOperation ?? throw new ArgumentNullException(nameof(solutionBindingOperation));
            this.NuGetBindingOperation    = nugetBindingOperation ?? throw new ArgumentNullException(nameof(nugetBindingOperation));
            this.unboundProjectFinder     = unboundProjectFinder ?? throw new ArgumentNullException(nameof(unboundProjectFinder));
            this.bindingConfigProvider    = bindingConfigProvider ?? throw new ArgumentNullException(nameof(bindingConfigProvider));
            this.bindingMode = bindingMode;

            Debug.Assert(bindingArgs.ProjectKey != null);
            Debug.Assert(bindingArgs.ProjectName != null);
            Debug.Assert(bindingArgs.Connection != null);

            this.projectSystem = this.host.GetService <IProjectSystemHelper>();
            this.projectSystem.AssertLocalServiceIsNotNull();

            this.InternalState = new BindingProcessState(isFirstBinding);
        }
        public BindingWorkflow(IHost host,
                               BindCommandArgs bindingArgs,
                               ISolutionBindingOperation solutionBindingOperation,
                               INuGetBindingOperation nugetBindingOperation,
                               ISolutionBindingInformationProvider bindingInformationProvider,
                               bool isFirstBinding = false)
        {
            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            if (bindingArgs == null)
            {
                throw new ArgumentNullException(nameof(bindingArgs));
            }
            Debug.Assert(bindingArgs.ProjectKey != null);
            Debug.Assert(bindingArgs.ProjectName != null);
            Debug.Assert(bindingArgs.Connection != null);

            if (solutionBindingOperation == null)
            {
                throw new ArgumentNullException(nameof(solutionBindingOperation));
            }

            if (nugetBindingOperation == null)
            {
                throw new ArgumentNullException(nameof(nugetBindingOperation));
            }

            if (bindingInformationProvider == null)
            {
                throw new ArgumentNullException(nameof(bindingInformationProvider));
            }

            this.host          = host;
            this.bindingArgs   = bindingArgs;
            this.projectSystem = this.host.GetService <IProjectSystemHelper>();
            this.projectSystem.AssertLocalServiceIsNotNull();

            this.solutionBindingOperation   = solutionBindingOperation;
            this.NuGetBindingOperation      = nugetBindingOperation;
            this.bindingInformationProvider = bindingInformationProvider;
            this.IsFirstBinding             = isFirstBinding;
        }