Ejemplo n.º 1
0
        protected override void BeforeQueryStatus(Microsoft.VisualStudio.Shell.OleMenuCommand command, SelectedItems selection)
        {
            var activeDocument = dte.ActiveDocument;

            if (activeDocument == null || activeDocument.ProjectItem == null)
            {
                command.Visible = false;
                return;
            }

            if (selection.Count != 1)
            {
                command.Enabled = false;
                return;
            }

            if (IsFeatureFile(activeDocument.ProjectItem))
            {
                command.Enabled = goToStepDefinitionCommand.IsEnabled(activeDocument);
                command.Text    = "Go To Step Definition";
            }
            else if (IsCodeFile(activeDocument.ProjectItem))
            {
                command.Enabled = goToStepsCommand.IsEnabled(activeDocument);
                command.Text    = "Go To SpecFlow Step Definition Usages";
            }
            else
            {
                command.Visible = false;
            }
        }