Esempio n. 1
0
        //List<FileTree<Directory>> localTrees;

        //public DirectoryView()
        //{
        //    localTrees = new List<FileTree<Directory>>();
        //    foreach (var drive in Environment.GetLogicalDrives())
        //    {
        //        localTrees.Add(new FileTree<Directory>(new LocalDirectory(drive)));
        //    }
        //}

        public static IHtmlContentBuilder GetHtmlListItems(FileTree <Directory> tree)
        {
            IHtmlContentBuilder builder = new HtmlContentBuilder();

            try
            {
                foreach (var item in tree.GetChildren())
                {
                    HtmlString name       = new HtmlString(item.Name);
                    HtmlString htmlString = new HtmlString(
                        "<a class=\"uk-link uk-link-text\" id=\"" + name + "\">" +
                        name +
                        "</a><br>");
                    builder.AppendHtml(htmlString);
                }
            }
            catch (Exception e)
            {
                ExceptionHandler.LogException(e);
            }

            return(builder);
        }