Пример #1
0
 public override void GoSearch(HtmlViewPane pane)
 {
     if (pane == null) {
         throw new ArgumentNullException("pane");
     }
     pane.Navigate(new Uri(string.Format(@"http://social.msdn.microsoft.com/Search/{0}", CultureInfo.CurrentCulture.Name.ToLower())));
 }
Пример #2
0
 protected BrowserPane(bool showNavigation)
 {
     htmlViewPane = new HtmlViewPane(showNavigation);
     htmlViewPane.WebBrowser.DocumentTitleChanged += new EventHandler(TitleChange);
     htmlViewPane.Closed += PaneClosed;
     TitleChange(null, null);
 }
Пример #3
0
 protected BrowserPane(bool showNavigation)
 {
     htmlViewPane = new HtmlViewPane(showNavigation);
     htmlViewPane.WebBrowser.DocumentTitleChanged += new EventHandler(TitleChange);
     htmlViewPane.Closed += PaneClosed;
     TitleChange(null, null);
 }
Пример #4
0
 public override void GoHome(HtmlViewPane pane)
 {
     if (pane == null) {
         throw new ArgumentNullException("pane");
     }
     DisplayHelp.Catalog();
 }
Пример #5
0
//		[PermissionSet(SecurityAction.LinkDemand, Name="Execution")]
		public override void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e)
		{
			if (pane == null)
			{
				throw new ArgumentNullException("pane");
			}
			ShowHelpBrowser.HighlightDocument(pane);
		}
Пример #6
0
		public override void GoSearch(HtmlViewPane pane)
		{
			if (pane == null)
			{
				throw new ArgumentNullException("pane");
			}
			pane.Navigate(new Uri(HtmlHelp2Environment.SearchPage));
		}
Пример #7
0
		public override void InterceptNavigate(HtmlViewPane pane, WebBrowserNavigatingEventArgs e)
		{
			e.Cancel = true;
			if (page == null) {
				page = new ICSharpCodePage();
				page.Title = ICSharpCode.Core.StringParser.Parse("${res:StartPage.StartPageContentName}");
			}
			string host = e.Url.Host;
			if (host == "project") {
				string projectFile = page.projectFiles[int.Parse(e.Url.LocalPath.Trim('/'))];
				FileUtility.ObservedLoad(new NamedFileOperationDelegate(ProjectService.LoadSolution), projectFile);
			} else {
				pane.WebBrowser.DocumentText = page.Render(host);
			}
		}
Пример #8
0
//		[PermissionSet(SecurityAction.LinkDemand, Name="Execution")]
		public override void InterceptNavigate(HtmlViewPane pane, WebBrowserNavigatingEventArgs e)
		{
			if (pane == null)
			{
				throw new ArgumentNullException("pane");
			}
			if (scriptObject == null) {
				scriptObject = new JScriptExternal();
				LoadHelpState();
			}
			pane.WebBrowser.ObjectForScripting = scriptObject;
			// add event (max. 1 one time)
			pane.WebBrowser.Disposed -= SaveHelpState;
			pane.WebBrowser.Disposed += SaveHelpState;
			base.InterceptNavigate(pane, e);
		}
        public bool IsValid(object caller, Condition condition)
        {
            HtmlViewPane pane    = (HtmlViewPane)caller;
            string       url     = pane.Url.ToString();
            string       pattern = condition.Properties["urlRegex"];
            string       options = condition.Properties["options"];

            if (options != null && options.Length > 0)
            {
                return(Regex.IsMatch(url, pattern, (RegexOptions)Enum.Parse(typeof(RegexOptions), options, true)));
            }
            else
            {
                return(Regex.IsMatch(url, pattern));
            }
        }
Пример #10
0
		public override void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e)
		{
			HtmlElement btn;
			btn = pane.WebBrowser.Document.GetElementById("opencombine");
			if (btn != null) {
				LoggingService.Debug("Attached event handler to opencombine button");
				btn.Click += delegate {new ICSharpCode.SharpDevelop.Project.Commands.LoadSolution().Run();};
			}
			btn = pane.WebBrowser.Document.GetElementById("newcombine");
			if (btn != null) {
				btn.Click += delegate {new ICSharpCode.SharpDevelop.Project.Commands.CreateNewSolution().Run();};
			}
			
			pane.WebBrowser.Navigating += pane_WebBrowser_Navigating;
			pane.WebBrowser.Navigated += pane_WebBrowser_Navigated;
		}
Пример #11
0
		public override void DocumentCompleted(HtmlViewPane pane, System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e)
		{
			if (pane == null) {
				throw new ArgumentNullException("pane");
			}

			ExtendedWebBrowser browser = pane.WebBrowser;
			HtmlElementCollection divs = browser.Document.GetElementsByTagName("div");
			foreach (HtmlElement div in divs) {
				if (!string.IsNullOrEmpty(div.Id)) {
					if (div.Id.Equals("LeftNav", StringComparison.InvariantCultureIgnoreCase) ||
					    div.Id.Equals("TocResize", StringComparison.InvariantCultureIgnoreCase))
					{
						div.Style = "visibility:hidden;display:none;width:0px";
					}
				}
			}
		}
Пример #12
0
		public virtual void GoSearch(HtmlViewPane pane)
		{
			pane.Navigate(HtmlViewPane.DefaultSearchUrl);
		}
Пример #13
0
		public virtual void GoHome(HtmlViewPane pane)
		{
			pane.Navigate(HtmlViewPane.DefaultHomepage);
		}
Пример #14
0
		public virtual void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e) {}
Пример #15
0
		public virtual void InterceptNavigate(HtmlViewPane pane, WebBrowserNavigatingEventArgs e) {}
Пример #16
0
		public override void GoHome(HtmlViewPane pane)
		{
			pane.Navigate("startpage://start/");
		}
Пример #17
0
 public virtual void GoSearch(HtmlViewPane pane)
 {
     pane.Navigate(HtmlViewPane.DefaultSearchUrl);
 }
Пример #18
0
 public virtual void GoHome(HtmlViewPane pane)
 {
     pane.Navigate(HtmlViewPane.DefaultHomepage);
 }
Пример #19
0
 public virtual void DocumentCompleted(HtmlViewPane pane, WebBrowserDocumentCompletedEventArgs e)
 {
 }
Пример #20
0
 public virtual void InterceptNavigate(HtmlViewPane pane, WebBrowserNavigatingEventArgs e)
 {
 }
Пример #21
0
		public static void HighlightDocument(HtmlViewPane htmlViewPane)
		{
			if (htmlViewPane == null)
			{
				throw new ArgumentNullException("htmlViewPane");
			}
			if (hiliteMatches && lastTopic != null)
			{
				lastTopic.HighlightDocument(htmlViewPane.WebBrowser.Document.DomDocument);
			}
		}