src/Misc/EFTools/EntityDesignPackage/CustomCode/MicrosoftDataEntityDesignPackage.cs
/// <summary>
///     Define a command handler.
///     When the user press the button corresponding to the CommandID
///     the EventHandler will be called.
/// </summary>
/// <param name="id">The CommandID (Guid/ID pair) as defined in the .ctc file</param>
/// <param name="invocationEventHandler">Method that should be called to implement the command</param>
/// <param name="queryStatusEventHandler">Method that should be called to ensure the status (visible/enabled) of the menu command</param>
/// <returns>The menu command. This can be used to set parameter such as the default visibility once the package is loaded</returns>
Define a command handler.
When the user press the button corresponding to the CommandID
the EventHandler will be called.
Define a command handler . When the user press the button corresponding to the CommandID the EventHandler will be called .
internal OleMenuCommand AddCommand(EventHandler invocationEventHandler, EventHandler queryStatusEventHandler, CommandID id)
        {
            if (Zombied)
            {
                return null;
            }
            var menuService = Services.OleMenuCommandService;
            OleMenuCommand command = null;
            if (null != menuService)
            {
                command = new OleMenuCommand(invocationEventHandler, null, queryStatusEventHandler, id);
                menuService.AddCommand(command);
            }
            return command;
        }
internal OleMenuCommand AddCommand ( EventHandler invocationEventHandler , EventHandler queryStatusEventHandler , CommandID id ) { if ( Zombied ) { return null ; } var menuService = Services . OleMenuCommandService ; OleMenuCommand command = null ; if ( null != menuService ) { command = new OleMenuCommand ( invocationEventHandler , null , queryStatusEventHandler , id ) ; menuService . AddCommand ( command ) ; } return command ; }
Define a command handler.
Define a command handler .
// if the package is zombied, we don't want to add commands // Add the command handler
The menu command. This can be used to set parameter such as the default visibility once the package is loaded
The menu command . This can be used to set parameter such as the default visibility once the package is loaded
invocationEventHandler
EventHandler
Method that should be called to implement the command
Method that should be called to implement the command
queryStatusEventHandler
EventHandler
Method that should be called to ensure the status (visible/enabled) of the menu command
Method that should be called to ensure the status ( visible / enabled ) of the menu command
id
CommandID
The CommandID (Guid/ID pair) as defined in the .ctc file
The CommandID ( Guid / ID pair ) as defined in the . ctc file