當前位置: 首頁>>代碼示例>>C#>>正文


C# HelpSource.GetText方法代碼示例

本文整理匯總了C#中Monodoc.HelpSource.GetText方法的典型用法代碼示例。如果您正苦於以下問題:C# HelpSource.GetText方法的具體用法?C# HelpSource.GetText怎麽用?C# HelpSource.GetText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Monodoc.HelpSource的用法示例。


在下文中一共展示了HelpSource.GetText方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetHtml

		public static string GetHtml (string url, HelpSource helpSource, out Node match)
		{
			string htmlContent = null;
			match = null;
			
			if (helpSource != null)
				htmlContent = helpSource.GetText (url, out match);
			if (htmlContent == null){
				htmlContent = AppDelegate.Root.RenderUrl (url, out match);
				if (htmlContent != null && match != null && match.tree != null){
					helpSource = match.tree.HelpSource;
				}
			}
			if (htmlContent == null)
				return null;
			
			var html = new StringWriter ();
   			html.Write ("<html>\n<head><title>{0}</title>", url);
			
			if (helpSource != null){
            	if (helpSource.InlineCss != null) 
                    html.Write (" <style type=\"text/css\">{0}</style>\n", helpSource.InlineCss);
				if (helpSource.InlineJavaScript != null)
                    html.Write ("<script type=\"text/JavaScript\">{0}</script>\n", helpSource.InlineJavaScript);
            }

            html.Write ("</head><body>");
            html.Write (htmlContent);
            html.Write ("</body></html>\n");
            return html.ToString ();
		}
開發者ID:kangaroo,項目名稱:monomac,代碼行數:31,代碼來源:DocTools.cs

示例2: GetHtml

		public static string GetHtml (string url, HelpSource helpSource, out Node match)
		{
			string htmlContent = null;
			match = null;
			
			if (helpSource != null)
				htmlContent = helpSource.GetText (url, out match);
			if (htmlContent == null){
				// the displayed url have a lower case type code (e.g. t: instead of T:) which confuse monodoc
				if (url.Length > 2 && url[1] == ':')
					url = char.ToUpperInvariant (url[0]) + url.Substring (1);
				htmlContent = AppDelegate.Root.RenderUrl (url, out match);
				if (htmlContent != null && match != null && match.tree != null){
					helpSource = match.tree.HelpSource;
				}
			}
			if (htmlContent == null)
				return null;
			
			var html = new StringWriter ();
   			html.Write ("<html>\n<head><title>{0}</title>", url);
			
			if (helpSource != null){
            	if (helpSource.InlineCss != null) 
                    html.Write (" <style type=\"text/css\">{0}</style>\n", helpSource.InlineCss);
				if (helpSource.InlineJavaScript != null)
                    html.Write ("<script type=\"text/JavaScript\">{0}</script>\n", helpSource.InlineJavaScript);
            }

            html.Write ("</head><body>");
            html.Write (htmlContent);
            html.Write ("</body></html>\n");
            return html.ToString ();
		}
開發者ID:garuma,項目名稱:monomac,代碼行數:34,代碼來源:DocTools.cs

示例3: GetHtml

		public static string GetHtml (string url, HelpSource helpSource, out Node match)
		{
			Console.WriteLine ("Calling URL {0} with HelpSource {1}", url, helpSource == null ? "(null)" : helpSource.Name);

			string htmlContent = null;
			match = null;
			
			if (helpSource != null)
				htmlContent = helpSource.GetText (url, out match);
			if (htmlContent == null){
				// the displayed url have a lower case type code (e.g. t: instead of T:) which confuse monodoc
				if (url.Length > 2 && url[1] == ':')
					url = char.ToUpperInvariant (url[0]) + url.Substring (1);
				// It may also be url encoded so decode it
				url = Uri.UnescapeDataString (url);
				htmlContent = Program.Root.RenderUrl (url, out match);
				if (htmlContent != null && match != null && match.tree != null){
					helpSource = match.tree.HelpSource;
				}
			}
			if (htmlContent == null)
				return null;
			
			var html = new StringWriter ();
   			html.Write ("<html>\n<head><title>{0}</title>", url);
			
			if (helpSource != null){
            	if (helpSource.InlineCss != null) 
                    html.Write (" <style type=\"text/css\">{0}</style>\n", helpSource.InlineCss);
				if (helpSource.InlineJavaScript != null)
                    html.Write ("<script type=\"text/JavaScript\">{0}</script>\n", helpSource.InlineJavaScript);
            }

            html.Write ("</head><body>");
            html.Write (htmlContent);
            html.Write ("</body></html>\n");
			return html.ToString ();
		}
開發者ID:remobjects,項目名稱:mono-tools,代碼行數:38,代碼來源:DocTools.cs

示例4: GetHtml

	public static string GetHtml (string url, HelpSource help_source, RootTree help_tree, out Node match)
	{
		match = null;
		string html_content = null;
		if (help_source != null)
			html_content = help_source.GetText (url, out match);
		if (html_content == null && help_tree != null) {
			html_content = help_tree.RenderUrl (url, out match);
			if (html_content != null && match != null && match.tree != null)
				help_source = match.tree.HelpSource;
		}

		if (html_content == null)
			return null;

		var html = new StringWriter ();
		html.Write ("<html>\n");
		html.Write ("  <head>\n");
		html.Write ("    <title>");
		html.Write (url);
		html.Write ("</title>\n");

		if (help_source != null && help_source.InlineCss != null) {
			html.Write ("    <style type=\"text/css\">\n");
			html.Write (help_source.InlineCss);
			html.Write ("    </style>\n");
		}
		if (help_source != null && help_source.InlineJavaScript != null) {
			html.Write ("    <script type=\"text/JavaScript\">\n");
			html.Write (help_source.InlineJavaScript);
			html.Write ("    </script>\n");
		}

		html.Write ("  </head>\n");
		html.Write ("  <body>\n");
		html.Write (html_content);
		html.Write ("  </body>\n");
		html.Write ("</html>");
		return html.ToString ();
	}
開發者ID:remobjects,項目名稱:mono-tools,代碼行數:40,代碼來源:browser.cs


注:本文中的Monodoc.HelpSource.GetText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。