コード例 #1
0
ファイル: IndexerHtml.cs プロジェクト: scfunknown/ShareX
        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));
        }
コード例 #2
0
ファイル: IndexerHtml.cs プロジェクト: scfunknown/ShareX
        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"));
        }