/// <summary> /// Gets a link to the Read page for a given article. /// </summary> /// <param name="articleTitle">The title of an article.</param> /// <param name="textToDisplay">The displayed text of the link.</param> /// <param name="articleVersion">The version (latest/approved) of the article.</param> /// <returns>A Link to Read an article.</returns> public static string GetLinkToRead(string articleTitle, string textToDisplay, RequestedArticleVersion articleVersion) { return GetLinkToRead(articleTitle, textToDisplay, string.Empty, articleVersion); }
/// <summary> /// Constructs a URL to the Read page for a section of a given article. /// </summary> /// <param name="articleTitle">The title of an article.</param> /// <param name="articleVersion">The requested version of the article.</param> /// <param name="section">A section within the article.</param> /// <returns>A URL to Read the article.</returns> public static string GetUrlToRead(string articleTitle, RequestedArticleVersion articleVersion, int section) { if (section < 0) return GetUrlToRead(articleTitle, articleVersion); else return GetUrlToRead(articleTitle, articleVersion) + "#" + section; }
/// <summary> /// Gets a link to the Read page for a given article. /// </summary> /// <param name="articleTitle">The title of an article.</param> /// <param name="textToDisplay">The displayed text of the link.</param> /// <param name="toolTip">The tooltip of the link.</param> /// <param name="articleVersion">The version (latest/approved) of the article.</param> /// <returns>A link to Read the article.</returns> private static string GetLinkToRead(string articleTitle, string textToDisplay, string toolTip, RequestedArticleVersion articleVersion) { textToDisplay = string.IsNullOrEmpty(textToDisplay) ? Tools.GetArticleTitle(articleTitle) : textToDisplay; toolTip = string.IsNullOrEmpty(toolTip) ? Tools.GetArticleTitleWithType(articleTitle) : toolTip; return string.Format(@"<a href=""{0}"" title=""{2}"">{1}</a>", GetUrlToRead(articleTitle, articleVersion), textToDisplay, toolTip); }
/// <summary> /// Constructs a URL to the Read page for a given article. /// </summary> /// <param name="articleTitle">The title of an article to Read.</param> /// <param name="articleVersion">The version (latest/approved) of the article.</param> /// <returns>A URL to Read the article.</returns> public static string GetUrlToRead(string articleTitle, RequestedArticleVersion articleVersion) { string versionUrlParameter = articleVersion == Tools.DEFAULT_ARTICLE_VERSION ? string.Empty : string.Format("&version={0}", articleVersion); return string.Format("./Read.aspx?page={0}{1}", Tools.TextToUrl(articleTitle), versionUrlParameter); }