예제 #1
0
        /// <summary>
        /// Gets the actions for changing the highlight options for StyleCop rules.
        /// </summary>
        /// <param name="highlighting">
        /// The current highlighting.
        /// </param>
        /// <param name="solution">
        /// The solution.
        /// </param>
        /// <param name="highlightingRange">
        /// The current highlighting range.
        /// </param>
        /// <param name="sourceFile">
        /// The file.
        /// </param>
        /// <returns>
        /// The available actions.
        /// </returns>
        public IEnumerable <JB::JetBrains.Util.Pair <IBulbAction, BulbMenuItemViewDescription> > GetActions(
            IHighlighting highlighting, ISolution solution, DocumentRange highlightingRange, IPsiSourceFile sourceFile)
        {
            StyleCopHighlightingBase violation = highlighting as StyleCopHighlightingBase;

            if (violation == null)
            {
                yield break;
            }

            string ruleId      = violation.CheckId;
            string highlightId = HighlightingRegistering.GetHighlightID(ruleId);

            ChangeStyleCopRuleAction changeStyleCopRuleAction = new ChangeStyleCopRuleAction(
                this.highlightingSettingsManager, this.settingsStore, highlightId, this.commonIconsComponent)
            {
                Text =
                    "Inspection Options for \"" + violation.ToolTip
                    + "\""
            };

            yield return
                (JB::JetBrains.Util.Pair.Of <IBulbAction, BulbMenuItemViewDescription>(
                     changeStyleCopRuleAction,
                     new BulbMenuItemViewDescription(AnchorsForConfigureHighlightingSubmenu.ConfigureItem, BulbThemedIcons.DisableBulb.Id, changeStyleCopRuleAction.Text)));
        }
        /// <summary>
        /// Gets the actions for changing the highlight options for StyleCop rules.
        /// </summary>
        /// <param name="highlighting">
        /// The current highlighting. 
        /// </param>
        /// <param name="solution">
        /// The solution. 
        /// </param>
        /// <param name="highlightingRange">
        /// The current highlighting range. 
        /// </param>
        /// <param name="sourceFile">
        /// The file. 
        /// </param>
        /// <returns>
        /// The available actions. 
        /// </returns>
        public IEnumerable<JB::JetBrains.Util.Pair<IBulbAction, BulbMenuItemViewDescription>> GetActions(
            IHighlighting highlighting, ISolution solution, DocumentRange highlightingRange, IPsiSourceFile sourceFile)
        {
            StyleCopHighlightingBase violation = highlighting as StyleCopHighlightingBase;

            if (violation == null)
            {
                yield break;
            }

            string ruleId = violation.CheckId;
            string highlightId = HighlightingRegistering.GetHighlightID(ruleId);

            ChangeStyleCopRuleAction changeStyleCopRuleAction = new ChangeStyleCopRuleAction(
                this.highlightingSettingsManager, this.settingsStore, highlightId, this.commonIconsComponent)
                                                                    {
                                                                        Text =
                                                                            "Inspection Options for \"" + violation.ToolTip
                                                                            + "\""
                                                                    };

            yield return
                JB::JetBrains.Util.Pair.Of<IBulbAction, BulbMenuItemViewDescription>(
                    changeStyleCopRuleAction, 
                    new BulbMenuItemViewDescription(AnchorsForConfigureHighlightingSubmenu.ConfigureItem, BulbThemedIcons.DisableBulb.Id, changeStyleCopRuleAction.Text));
        }