示例#1
0
        public void RefreshInstance()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (_solutionDir.Length == 0 && _serviceProvider != null)
            {
                DTE2 applicationObject = _serviceProvider.GetService(typeof(SDTE)) as DTE2;
                Assumes.Present(applicationObject);
                string solutionDirRaw = applicationObject.Solution.FullName;

                if (solutionDirRaw.Length > 0)
                {
                    //A valid solution folder was found
                    _solutionDir = (Path.HasExtension(solutionDirRaw)? Path.GetDirectoryName(solutionDirRaw) : solutionDirRaw) + '\\';

                    //Get the information from the settings
                    GeneralSettingsPageGrid settings = GetGeneralSettings();
                    if (SetPath(settings.OptionPath) || SetScoreFileName(settings.OptionScoreFileName))
                    {
                        ReloadSeverities();
                    }

                    //Trigger settings refresh
                    OnHighlightEnabledChanged();
                }
            }
        }
示例#2
0
        private bool RefreshEnable()
        {
            GeneralSettingsPageGrid settings = CompilerData.Instance.GetGeneralSettings();
            bool newValue = settings != null ? settings.OptionHighlightMode != GeneralSettingsPageGrid.HighlightMode.Disabled : false;

            if (IsEnabled != newValue)
            {
                IsEnabled = newValue;
                return(true);
            }
            return(false);
        }
示例#3
0
        private bool RefreshEnable()
        {
            GeneralSettingsPageGrid settings = CompilerData.Instance.GetGeneralSettings();
            bool isEnabled = settings != null? settings.OptionHighlightEnabled : false;

            if (isEnabled != _enabled)
            {
                _enabled = isEnabled;
                return(true);
            }
            return(false);
        }
示例#4
0
        private void RecomputeSeverities()
        {
            GeneralSettingsPageGrid settings = GetGeneralSettings();

            for (int i = 0; i < Enum.GetNames(typeof(CompileCategory)).Length; ++i)
            {
                CompileDataset dataset       = _datasets[(int)CompileCategory.Include];
                List <uint>    thresholdList = settings.OptionNormalizedSeverity ? dataset.normalizedThresholds : settings.GetOptionSeverities();
                foreach (CompileValue entry in dataset.collection)
                {
                    entry.Severity = ComputeSeverity(thresholdList, entry.Max);
                }
            }
        }
示例#5
0
        private void RecomputeSeverities()
        {
            GeneralSettingsPageGrid settings = GetGeneralSettings();

            //For the time being we are only using Include data for this
            //Only compute it for include for now
            const int i = (int)CompileCategory.Include;

            //for (int i = 0; i < (int)CompileCategory.GatherCount; ++i)
            {
                CompileDataset dataset       = Datasets[i];
                List <uint>    thresholdList = settings.OptionNormalizedSeverity ? dataset.normalizedThresholds : settings.GetOptionSeverities();
                foreach (CompileValue entry in dataset.collection)
                {
                    entry.Severity = ComputeSeverity(thresholdList, entry.Max);
                }
            }
        }
示例#6
0
        private bool IsEnabled()
        {
            GeneralSettingsPageGrid settings = CompilerData.Instance.GetGeneralSettings();

            return(settings != null ? settings.OptionTooltipEnabled : false);
        }