public BindingConfiguration GetConfiguration()
        {
            var project = legacySerializer.ReadSolutionBinding();

            if (project != null)
            {
                return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true));
            }

            return(wrappedProvider.GetConfiguration());
        }
예제 #2
0
        public BindingConfiguration GetConfiguration()
        {
            var project = legacySerializer.ReadSolutionBinding();

            if (project != null)
            {
                var config = BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true);

                // Make sure the new config has the same value
                wrappedProvider.WriteConfiguration(config);
                return(config);
            }

            return(wrappedProvider.GetConfiguration());
        }
        public BindingConfiguration GetConfiguration()
        {
            var project = legacySerializer.ReadSolutionBinding();

            if (project != null)
            {
                return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true));
            }

            project = newConnectedModeSerializer.ReadSolutionBinding();
            if (project != null)
            {
                return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: false));
            }

            return(BindingConfiguration.Standalone);
        }
        private BoundSonarQubeProject SafeReadBindingInformation()
        {
            ISolutionBindingSerializer solutionBinding = this.GetService <ISolutionBindingSerializer>();

            solutionBinding.AssertLocalServiceIsNotNull();

            BoundSonarQubeProject bound = null;

            try
            {
                bound = solutionBinding.ReadSolutionBinding();
            }
            catch (Exception ex)
            {
                if (ErrorHandler.IsCriticalException(ex))
                {
                    throw;
                }

                Debug.Fail("Unexpected exception: " + ex.ToString());
            }

            return(bound);
        }