예제 #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);
			}
		}