本文整理汇总了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 ();
}
示例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 ();
}
示例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 ();
}
示例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 ();
}