mirror of
https://bitbucket.org/anguist/ntpa
synced 2026-10-06 11:42:03 +00:00
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using System;
|
|
|
|
namespace Ntp.Analyzer.Render
|
|
{
|
|
public static class HtmlExtension
|
|
{
|
|
public static string AppendWithWebpath(this IHtmlObject htmlObject, string line, string link)
|
|
{
|
|
if (link.StartsWith("http") || link.StartsWith("https") || link.StartsWith("mailto"))
|
|
return String.Format(line, String.Empty, link);
|
|
|
|
return String.Format(line, htmlObject.WebPath, link);
|
|
}
|
|
|
|
public static string AppendWithWebpath(this IHtmlObject htmlObject, string line, string link, object arg0)
|
|
{
|
|
if (link.StartsWith("http") || link.StartsWith("https") || link.StartsWith("mailto"))
|
|
return String.Format(line, String.Empty, link, arg0);
|
|
|
|
return String.Format(line, htmlObject.WebPath, link, arg0);
|
|
}
|
|
|
|
public static string AppendWithWebpath(this IHtmlObject htmlObject, string line, string link, object arg0, object arg1)
|
|
{
|
|
if (link.StartsWith("http") || link.StartsWith("https") || link.StartsWith("mailto"))
|
|
return String.Format(line, String.Empty, link, arg0, arg1);
|
|
|
|
return String.Format(line, htmlObject.WebPath, link, arg0, arg1);
|
|
}
|
|
}
|
|
} |