private void LoadTexturesTree(GameObjectCategoryViewModel texturesCategory)
        {
            var fis = new List<FileInfo>();
            var folders = new List<FolderViewModel>();

            var textureDirectories =
                Directory
                .GetDirectories(RelativePaths.Textures);
            foreach (var path in textureDirectories)
            {
                var di = new DirectoryInfo(path);
                fis.AddRange(di.GetFiles("*.jpg", SearchOption.AllDirectories));
            }

            foreach (var fi in fis)
            {
                var folder = GetFolderFor(texturesCategory, folders, fi);
                var texture = new TextureViewModel(folder, _nodeAddCB, fi.Name, fi.FullName);
                folder.Children.Add(texture);
            }

            folders.ForEach(f => texturesCategory.Children.Add(f));
        }
        private void LoadActorsTree(GameObjectCategoryViewModel actorsCategory)
        {
            var assembly = Assembly.Load("StoryTimeFramework");
            var folder = new AssemblyViewModel(actorsCategory, _nodeAddCB, "StoryTimeFramework");

            var baseType = typeof(BaseActor);
            var actorTypes = assembly.GetTypes()
                .Where(t => t != baseType && baseType.IsAssignableFrom(t))
                .Select(t =>
                {
                    return new ActorViewModel(
                        folder,
                        _nodeAddCB,
                        t,
                        assembly.GetName().Name);
                })
                .ToList();

            actorTypes.ForEach(a => folder.Children.Add(a));
            actorsCategory.Children.Add(folder);
        }
 private void LoadScenesTree(GameObjectCategoryViewModel scenes)
 {
     var di = new DirectoryInfo(RelativePaths.Scenes);
     AddScenesAndFolders(scenes, di);
 }
        private FolderViewModel GetFolderFor(
            GameObjectCategoryViewModel texturesCategory, 
            List<FolderViewModel> folders, 
            FileInfo fi)
        {
            var folderName = fi.DirectoryName.Replace(fi.Directory.FullName, fi.Directory.Name);
            var folder =
                folders
                .SingleOrDefault(f => f.FolderFullPath == fi.Directory.FullName);

            if (folder != null)
                return folder;

            folder = new FolderViewModel(
                texturesCategory,
                _nodeAddCB,
                fi.DirectoryName.Replace(fi.Directory.FullName, fi.Directory.Name),
                fi.Directory.FullName);

            folders.Add(folder);
            return folder;
        }