Пример #1
0
        /// <summary>
        /// Add the standard command set to our command table
        /// </summary>
        private void AddCommands()
        {
            // save away references to selected DirectInvoke commands prior to adding them
            m_goBackCommand    = new GoBackBrowserCommand(m_browser);
            m_goForwardCommand = new GoForwardBrowserCommand(m_browser);
            m_stopCommand      = new StopBrowserCommand(m_browser);

            // standard file menu commands (figure out how to do New Window and Open)
            AddCommand(BrowserCommand.NewWindow, new NewWindowBrowserCommand(m_browser));
            AddCommand(BrowserCommand.SaveAs, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_SAVEAS));
            AddCommand(BrowserCommand.PageSetup, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PAGESETUP));
            AddCommand(BrowserCommand.Print, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PRINT));
            AddCommand(BrowserCommand.PrintPreview, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PRINTPREVIEW));
            AddCommand(BrowserCommand.Properties, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PROPERTIES));

            // standard edit menu commands
            AddCommand(BrowserCommand.Cut, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_CUT));
            AddCommand(BrowserCommand.Copy, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_COPY));
            AddCommand(BrowserCommand.Paste, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PASTE));
            AddCommand(BrowserCommand.SelectAll, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_SELECTALL));
            AddCommand(BrowserCommand.Find, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.Find));

            // standard view menu commands
            AddCommand(BrowserCommand.GoBack, m_goBackCommand);
            AddCommand(BrowserCommand.GoForward, m_goForwardCommand);
            AddCommand(BrowserCommand.Stop, m_stopCommand);
            AddCommand(BrowserCommand.Refresh, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_REFRESH));
            AddCommand(BrowserCommand.GoHome, new GoHomeBrowserCommand(m_browser));
            AddCommand(BrowserCommand.GoSearch, new GoSearchBrowserCommand(m_browser));
            AddCommand(BrowserCommand.ViewSource, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.ViewSource));
            AddCommand(BrowserCommand.Languages, new LanguagesBrowserCommand(m_browser));

            // standard favorites menu commands
            AddCommand(BrowserCommand.AddFavorite, new AddFavoriteBrowserCommand(m_browser));
            AddCommand(BrowserCommand.OrganizeFavorites, new OrganizeFavoritesBrowserCommand(m_browser));

            // standard tools menu commands
            AddCommand(BrowserCommand.InternetOptions, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.InternetOptions));
        }
        /// <summary>
        /// Add the standard command set to our command table
        /// </summary>
        private void AddCommands()
        {
            // save away references to selected DirectInvoke commands prior to adding them
            m_goBackCommand = new GoBackBrowserCommand(m_browser);
            m_goForwardCommand = new GoForwardBrowserCommand(m_browser);
            m_stopCommand = new StopBrowserCommand(m_browser);

            // standard file menu commands (figure out how to do New Window and Open)
            AddCommand(BrowserCommand.NewWindow, new NewWindowBrowserCommand(m_browser));
            AddCommand(BrowserCommand.SaveAs, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_SAVEAS));
            AddCommand(BrowserCommand.PageSetup, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PAGESETUP));
            AddCommand(BrowserCommand.Print, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PRINT));
            AddCommand(BrowserCommand.PrintPreview, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PRINTPREVIEW));
            AddCommand(BrowserCommand.Properties, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PROPERTIES));

            // standard edit menu commands
            AddCommand(BrowserCommand.Cut, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_CUT));
            AddCommand(BrowserCommand.Copy, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_COPY));
            AddCommand(BrowserCommand.Paste, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_PASTE));
            AddCommand(BrowserCommand.SelectAll, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_SELECTALL));
            AddCommand(BrowserCommand.Find, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.Find));

            // standard view menu commands
            AddCommand(BrowserCommand.GoBack, m_goBackCommand);
            AddCommand(BrowserCommand.GoForward, m_goForwardCommand);
            AddCommand(BrowserCommand.Stop, m_stopCommand);
            AddCommand(BrowserCommand.Refresh, new StandardBrowserCommand(m_browser, OLECMDID.OLECMDID_REFRESH));
            AddCommand(BrowserCommand.GoHome, new GoHomeBrowserCommand(m_browser));
            AddCommand(BrowserCommand.GoSearch, new GoSearchBrowserCommand(m_browser));
            AddCommand(BrowserCommand.ViewSource, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.ViewSource));
            AddCommand(BrowserCommand.Languages, new LanguagesBrowserCommand(m_browser));

            // standard favorites menu commands
            AddCommand(BrowserCommand.AddFavorite, new AddFavoriteBrowserCommand(m_browser));
            AddCommand(BrowserCommand.OrganizeFavorites, new OrganizeFavoritesBrowserCommand(m_browser));

            // standard tools menu commands
            AddCommand(BrowserCommand.InternetOptions, new PrivateBrowserCommand(m_browser, PrivateBrowserCommand.InternetOptions));
        }