public ProjectStartPageView(IEventAggregator eventAggregator, IWorkbenchService workbenchService)
 {
     _eventAggregator = eventAggregator;
     this.HideOnClose = false;
     this.TabText     = "Browser";
     _browserPane.View.GetSchemeFunc = (sender, e) =>
     {
         if (e.SchemeName.Equals(ProjectStartPageScheme.SCHEMENAME, StringComparison.CurrentCultureIgnoreCase))
         {
             return(ProjectStartPageScheme.Instance);
         }
         else
         {
             return(null);
         }
     };
     _browserPane.View.StatusTextChanged = (e) => { workbenchService.SetStatusMessage(e); };
     _browserPane.View.TitleChanged      = (e) => { this.TabText = e; };
     this.Controls.Add(_browserPane.View);
     _browserPane.Navigate(ProjectStartPageScheme.PROJECT_STARTPAGE_URI);
     this.Single      = true;
     this.SingleKey   = ProjectStartPageScheme.PROJECT_STARTPAGE_URI;
     this.HideOnClose = true;
     SubscribeEvents();
 }
示例#2
0
        static void DisplayLocalHelp(string arguments, bool embedded)
        {
            if (string.IsNullOrEmpty(arguments))
            {
                throw new ArgumentNullException("arguments");
            }
            if (!Help3Environment.IsLocalHelp)
            {
                return;
            }
            if (!HelpLibraryAgent.IsRunning)
            {
                HelpLibraryAgent.Start();
                Thread.Sleep(0x3e8);
            }
            string helpUrl = string.Format(@"{0}{1}{2}",
                                           arguments, ProjectLanguages.GetCurrentLanguageAsHttpParam(), (embedded)?"&embedded=true":string.Empty);

            if (Help3Service.Config.ExternalHelp)
            {
                DisplayHelpWithShellExecute(helpUrl);
                return;
            }
            BrowserPane browser = ActiveHelp3Browser();

            if (browser != null)
            {
                LoggingService.Info(string.Format("Help 3.0: Navigating to {0}", helpUrl));
                browser.Navigate(Help3Environment.GetHttpFromMsXHelp(helpUrl));
                browser.WorkbenchWindow.SelectWindow();
            }
        }
示例#3
0
        /// <summary>
        /// 执行显示网页的命令。
        /// </summary>
        public override void Run()
        {
            try
            {
                foreach (IViewContent view in WorkbenchSingleton.Workbench.ViewContentCollection)
                {
                    if (view.TitleName == _titleName)
                    {
                        view.WorkbenchWindow.SelectWindow();
                        return;
                    }
                }

                BrowserPane pane = new BrowserPane(false);
                pane.TitleName = _titleName;
                pane.Navigate(_url);
                pane.TitleNameChanged += new EventHandler((o, e) =>
                {
                    _titleName = pane.TitleName;
                });
                WorkbenchSingleton.Workbench.ShowView(pane);
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
        }
示例#4
0
        public static void OpenHelpView(string topicLink, IHxTopic topic, bool hiliteMatchingWords)
        {
            hiliteMatches = hiliteMatchingWords;
            lastTopic     = topic;
            BrowserPane help2Browser = ActiveHelp2BrowserView();

            if (help2Browser != null)
            {
                help2Browser.Navigate(topicLink);
                help2Browser.WorkbenchWindow.SelectWindow();
            }
        }
示例#5
0
 public BrowserView(BrowserPane browserPane, Uri url)
 {
     InitializeComponent();
     this.HideOnClose  = false;
     this.TabText      = "Browser";
     _workbenchService = ServiceUnity.Container.Resolve <IWorkbenchService>();
     browserPane.View.StatusTextChanged = (e) => { _workbenchService.SetStatusMessage(e); };
     browserPane.View.TitleChanged      = (e) => { this.TabText = e; };
     browserPane.View.NewWindow        += (sender, e) => { _workbenchService.Show(new BrowserView(e.BrowserPane, e.Url)); };
     this.Controls.Add(browserPane.View);
     browserPane.Navigate(url.ToString());
 }
示例#6
0
        static void DisplaySearchOnMSDN(string searchWords)
        {
            if (string.IsNullOrEmpty(searchWords))
            {
                throw new ArgumentNullException("searchWords");
            }
            string      msdnUrl = string.Format(@"http://social.msdn.microsoft.com/Search/{0}/?query={1}&ac=3", CultureInfo.CurrentUICulture.ToString(), searchWords.Replace(" ", "+"));
            BrowserPane browser = ActiveHelp3Browser();

            if (browser != null)
            {
                LoggingService.Info(string.Format("Help 3.0: Navigating to {0}", msdnUrl));
                browser.Navigate(msdnUrl);
                browser.WorkbenchWindow.SelectWindow();
            }
        }
示例#7
0
        static void DisplayHelpOnMSDN(string keyword)
        {
            if (string.IsNullOrEmpty(keyword))
            {
                throw new ArgumentNullException("keyword");
            }
            string msdnUrl = string.Format(@"http://msdn.microsoft.com/library/{0}.aspx", keyword);

            if (Help3Service.Config.ExternalHelp)
            {
                DisplayHelpWithShellExecute(msdnUrl);
                return;
            }
            BrowserPane browser = ActiveHelp3Browser();

            if (browser != null)
            {
                LoggingService.Info(string.Format("Help 3.0: Navigating to {0}", msdnUrl));
                browser.Navigate(msdnUrl);
                browser.WorkbenchWindow.SelectWindow();
            }
        }
        private void InitialiseForm()
        {
            this.Controls.Add(_menuStrip);
            _menuStrip.BringToFront();
            this.Controls.Add(_toolStripPanel);
            _menuStrip.SendToBack();

            _webBrowser.Dock   = DockStyle.Bottom;
            _webBrowser.Height = 100;
            this.Controls.Add(_webBrowser);
            _webBrowser.BringToFront();
            _webBrowser.Navigate("http://www.shengxunwei.com/banner.html");


            //browserPane
            _browserPane.View.GetSchemeFunc = (sender, e) =>
            {
                if (e.SchemeName.Equals(StartPageScheme.SCHEMENAME, StringComparison.CurrentCultureIgnoreCase))
                {
                    return(StartPageScheme.Instance);
                }
                else
                {
                    return(null);
                }
            };

            //_browserPane.View.StatusTextChanged = (e) => { workbenchService.SetStatusMessage(e); };
            //_browserPane.View.TitleChanged = (e) => { this.TabText = e; };
            //_browserPane.View.NewWindow += (sender, e) => { workbenchService.Show(new BrowserView(e.BrowserPane, e.Url)); };

            this.Controls.Add(_browserPane.View);
            _browserPane.View.BringToFront();

            _browserPane.Navigate(StartPageScheme.STARTPAGE_URI);

            InitAreo();
            this.Activate();
        }