src/Misc/EFTools/DesignXmlCore/VisualStudio/Package/ExplorerWindow.cs
/// <summary>
///     This is called after our control has been created and sited.
///     This is a good place to initialize the control with data gathered
///     from Visual Studio services.
/// </summary>
This is called after our control has been created and sited.
This is a good place to initialize the control with data gathered
from Visual Studio services.
This is called after our control has been created and sited . This is a good place to initialize the control with data gathered from Visual Studio services .
public override void OnToolWindowCreated()
        {
            base.OnToolWindowCreated();
            Caption = _package.GetResourceString("ExplorerWindowTitle");
            IServiceProvider serviceProvider = _package;
            if (serviceProvider != null)
            {
                var packageMenuService = serviceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
                _menuService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
                if (packageMenuService != null
                    && _menuService != null)
                {
                    var cmd = packageMenuService.FindCommand(StandardCommands.Delete);
                    if (cmd != null)
                    {
                        _menuService.AddCommand(cmd);
                    }
                    cmd = packageMenuService.FindCommand(StandardCommands.Cut);
                    if (cmd != null)
                    {
                        _menuService.AddCommand(cmd);
                    }
                    cmd = packageMenuService.FindCommand(StandardCommands.Copy);
                    if (cmd != null)
                    {
                        _menuService.AddCommand(cmd);
                    }
                    cmd = packageMenuService.FindCommand(StandardCommands.Paste);
                    if (cmd != null)
                    {
                        _menuService.AddCommand(cmd);
                    }
                    DefineSearchCommands();
                    vsEventBroadcaster = new VSEventBroadcaster(serviceProvider);
                    vsEventBroadcaster.Initialize();
                    vsEventBroadcaster.OnFontChanged += vsEventBroadcaster_OnFontChanged;
                }
            }
        }
public override void OnToolWindowCreated ( ) { base . OnToolWindowCreated ( ) ; Caption = _package . GetResourceString ( " " ) ; IServiceProvider serviceProvider = _package ; if ( serviceProvider != null ) { var packageMenuService = serviceProvider . GetService ( typeof ( IMenuCommandService ) ) as OleMenuCommandService ; _menuService = GetService ( typeof ( IMenuCommandService ) ) as OleMenuCommandService ; if ( packageMenuService != null && _menuService != null ) { var cmd = packageMenuService . FindCommand ( StandardCommands . Delete ) ; if ( cmd != null ) { _menuService . AddCommand ( cmd ) ; } cmd = packageMenuService . FindCommand ( StandardCommands . Cut ) ; if ( cmd != null ) { _menuService . AddCommand ( cmd ) ; } cmd = packageMenuService . FindCommand ( StandardCommands . Copy ) ; if ( cmd != null ) { _menuService . AddCommand ( cmd ) ; } cmd = packageMenuService . FindCommand ( StandardCommands . Paste ) ; if ( cmd != null ) { _menuService . AddCommand ( cmd ) ; } DefineSearchCommands ( ) ; vsEventBroadcaster = new VSEventBroadcaster ( serviceProvider ) ; vsEventBroadcaster . Initialize ( ) ; vsEventBroadcaster . OnFontChanged += vsEventBroadcaster_OnFontChanged ; } } }
This is called after our control has been created and sited.
This is called after our control has been created and sited .
// Set the text that will appear in the title bar of the tool window. // Note that because we need access to the package for localization, // we have to wait to do this here. If we used a constant string, // we could do this in the consturctor.