Work on project manager and project panel

This commit is contained in:
2014-07-27 16:21:06 +03:00
parent 48972dfb52
commit 5e526fa48c
40 changed files with 961 additions and 139 deletions

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using RainmeterStudio.Model;
namespace RainmeterStudio.Utils
{
public static class DirectoryHelper
{
public static Tree<Reference> GetFolderTree(string folder)
{
// Build tree object
Reference reference = new Reference(Path.GetFileName(folder), folder);
Tree<Reference> tree = new Tree<Reference>(reference);
// Navigate folder structure
if (Directory.Exists(folder))
{
foreach (var item in Directory.EnumerateDirectories(folder)
.Concat(Directory.EnumerateFiles(folder)))
{
tree.Add(GetFolderTree(item));
}
}
// Return tree
return tree;
}
}
}