protected override string GetFolderNameRow(FolderInfo dir, int level) { int heading = (level + 1).Between(1, 6); string folderInfoText = string.Empty; if (!dir.IsEmpty) { folderInfoText = dir.Size.ToSizeString(config.BinaryUnits) + " ("; if (dir.TotalFileCount > 0) { folderInfoText += dir.TotalFileCount + " file" + (dir.TotalFileCount > 1 ? "s" : ""); } if (dir.TotalFolderCount > 0) { if (dir.TotalFileCount > 0) { folderInfoText += ", "; } folderInfoText += dir.TotalFolderCount + " folder" + (dir.TotalFolderCount > 1 ? "s" : ""); } folderInfoText += ")"; folderInfoText = " " + HtmlHelper.Tag("span", folderInfoText, "", "class=\"folderinfo\""); } return(HtmlHelper.StartTag("h" + heading) + URLHelpers.HtmlEncode(dir.FolderName) + folderInfoText + HtmlHelper.EndTag("h" + heading)); }
private string GetFileNameRow(FileInfo fi, int level) { string fileNameRow = HtmlHelper.StartTag("li") + URLHelpers.HtmlEncode(fi.Name); if (settings.ShowSizeInfo) { fileNameRow += " " + HtmlHelper.Tag("span", fi.Length.ToSizeString(settings.BinaryUnits), "", "class=\"FileSize\""); } fileNameRow += HtmlHelper.EndTag("li"); return(fileNameRow); }
private string GetFolderNameRow(FolderInfo dir, int level) { string folderNameRow = ""; if (!dir.IsEmpty) { if (settings.ShowSizeInfo) { folderNameRow += dir.Size.ToSizeString(settings.BinaryUnits) + " "; } folderNameRow += "("; if (dir.TotalFileCount > 0) { folderNameRow += dir.TotalFileCount.ToString("n0") + " file" + (dir.TotalFileCount > 1 ? "s" : ""); } if (dir.TotalFolderCount > 0) { if (dir.TotalFileCount > 0) { folderNameRow += ", "; } folderNameRow += dir.TotalFolderCount.ToString("n0") + " folder" + (dir.TotalFolderCount > 1 ? "s" : ""); } folderNameRow += ")"; folderNameRow = " " + HtmlHelper.Tag("span", folderNameRow, "", "class=\"FolderInfo\""); } string pathTitle; if (settings.DisplayPath) { pathTitle = settings.DisplayPathLimited ? dir.FolderPath.Substring(prePathTrim) : dir.FolderPath; } else { pathTitle = dir.FolderName; } int heading = (level + 1).Clamp(1, 6); return(HtmlHelper.StartTag("h" + heading) + URLHelpers.HtmlEncode(pathTitle) + folderNameRow + HtmlHelper.EndTag("h" + heading)); }
private string GetFolderNameRow(FolderInfo dir, int level) { string folderNameRow = ""; if (!dir.IsEmpty) { if (settings.ShowSizeInfo) { folderNameRow += dir.Size.ToSizeString(settings.BinaryUnits) + " "; } folderNameRow += "("; if (dir.TotalFileCount > 0) { folderNameRow += dir.TotalFileCount + " file" + (dir.TotalFileCount > 1 ? "s" : ""); } if (dir.TotalFolderCount > 0) { if (dir.TotalFileCount > 0) { folderNameRow += ", "; } folderNameRow += dir.TotalFolderCount + " folder" + (dir.TotalFolderCount > 1 ? "s" : ""); } folderNameRow += ")"; folderNameRow = " " + HtmlHelper.Tag("span", folderNameRow, "", "class=\"FolderInfo\""); } int heading = (level + 1).Clamp(1, 6); return(HtmlHelper.StartTag("h" + heading) + URLHelpers.HtmlEncode(dir.FolderName) + folderNameRow + HtmlHelper.EndTag("h" + heading)); }
public static string Tag(string tag, string content, string style = "", string otherFields = "") { return(StartTag(tag, style, otherFields) + URLHelpers.HtmlEncode(content) + EndTag(tag)); }
protected override string GetFileNameRow(FileInfo fi, int level) { string size = " " + HtmlHelper.Tag("span", fi.Length.ToSizeString(config.BinaryUnits), "", "class=\"filesize\""); return(HtmlHelper.StartTag("li") + URLHelpers.HtmlEncode(fi.Name) + size + HtmlHelper.EndTag("li")); }