Esempio n. 1
0
        //private readonly ToolStripButton _btnStop;
        //private readonly ToolStripButton _btnRefresh;

        public WebBrowserViewToolbar(WebBrowserView view)
        {
            Verify.Argument.IsNotNull(view, nameof(view));

            _view = view;

            Items.Add(_btnGoBack = new ToolStripButton(
                          Resources.StrBack,
                          Resources.ImgGoBack,
                          (s, e) =>
            {
                if (_view.WebBrowser.CanGoBack)
                {
                    _view.WebBrowser.GoBack();
                }
            })
            {
                Enabled = _view.WebBrowser.CanGoBack,
            });

            Items.Add(_btnGoForward = new ToolStripButton(
                          Resources.StrForward,
                          Resources.ImgGoForward,
                          (s, e) =>
            {
                if (_view.WebBrowser.CanGoForward)
                {
                    _view.WebBrowser.GoForward();
                }
            })
            {
                Enabled      = _view.WebBrowser.CanGoForward,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
            });

            Items.Add(_addressBox = new ToolStripTextBox("AddressBox")
            {
                AutoSize = false,
                Width    = 250,
            });

            _view.WebBrowser.CanGoBackChanged    += OnWebBrowserCanGoBackChanged;
            _view.WebBrowser.CanGoForwardChanged += OnWebBrowserCanGoForwardChanged;
            _view.WebBrowser.Navigating          += OnWebBrowserNavigating;
        }
Esempio n. 2
0
        //private readonly ToolStripButton _btnStop;
        //private readonly ToolStripButton _btnRefresh;
        public WebBrowserViewToolbar(WebBrowserView view)
        {
            Verify.Argument.IsNotNull(view, "view");

            _view = view;

            Items.Add(_btnGoBack = new ToolStripButton(
                Resources.StrBack,
                Resources.ImgGoBack,
                (s, e) =>
                {
                    if(_view.WebBrowser.CanGoBack)
                    {
                        _view.WebBrowser.GoBack();
                    }
                })
                {
                    Enabled = _view.WebBrowser.CanGoBack,
                });

            Items.Add(_btnGoForward = new ToolStripButton(
                Resources.StrForward,
                Resources.ImgGoForward,
                (s, e) =>
                {
                    if(_view.WebBrowser.CanGoForward)
                    {
                        _view.WebBrowser.GoForward();
                    }
                })
                {
                    Enabled = _view.WebBrowser.CanGoForward,
                    DisplayStyle = ToolStripItemDisplayStyle.Image,
                });

            Items.Add(_addressBox = new ToolStripTextBox("AddressBox")
                {
                    AutoSize = false,
                    Width = 250,
                });

            _view.WebBrowser.CanGoBackChanged += OnWebBrowserCanGoBackChanged;
            _view.WebBrowser.CanGoForwardChanged += OnWebBrowserCanGoForwardChanged;
            _view.WebBrowser.Navigating += OnWebBrowserNavigating;
        }