Ejemplo n.º 1
0
        protected override void BeforeQueryStatus(OleMenuCommand command, SelectedItems selection)
        {
            base.BeforeQueryStatus(command, selection);

            if (command.Visible)
            {
                var selectedItem = selection.Item(1);
                if (selectedItem.ProjectItem == null ||
                    !VsxHelper.IsPhysicalFile(selectedItem.ProjectItem) ||
                    !ContextDependentNavigationCommand.IsFeatureFile(selectedItem.ProjectItem))
                {
                    command.Visible = false; //only show it in feature file nodes
                }
            }
        }
        protected override void BeforeQueryStatus(OleMenuCommand command, SelectedItems selection)
        {
            base.BeforeQueryStatus(command, selection);

            if (command.Visible)
            {
                if (dte.ActiveDocument == null || dte.ActiveDocument.ProjectItem == null || !ContextDependentNavigationCommand.IsFeatureFile(dte.ActiveDocument.ProjectItem))
                {
                    command.Visible = false;
                }
            }
        }