test/Misc/EFTools/TestInfrastructure/VS/DesignerUtilities.cs
/// <summary>
///     Check if the given menu item is currently available
/// </summary>
/// <param name="dte">The DTE object</param>
/// <param name="menuItem">The menu item to check</param>
/// <returns>true if the menu item is currently available, false otherwise</returns>
Check if the given menu item is currently available
Check if the given menu item is currently available
public static bool IsMenuItemAvailable(DTE dte, MenuItem menuItem)
            {
                var menuItemName = CommandStrings[menuItem];
                foreach (Command command in dte.Commands)
                {
                    if (string.Equals(menuItemName, command.Name, StringComparison.Ordinal))
                    {
                        return command.IsAvailable;
                    }
                }
                return false;
            }
public static bool IsMenuItemAvailable ( DTE dte , MenuItem menuItem ) { var menuItemName = CommandStrings [ menuItem ] ; foreach ( Command command in dte . Commands ) { if ( string . Equals ( menuItemName , command . Name , StringComparison . Ordinal ) ) { return command . IsAvailable ; } } return false ; }
Check if the given menu item is currently available
Check if the given menu item is currently available
true if the menu item is currently available, false otherwise
true if the menu item is currently available false otherwise
dte
DTE
The DTE object
The DTE object
menuItem
MenuItem
The menu item to check
The menu item to check