public IEnumerable<HierarchyNode> GetChildren(HierarchyNode node)
 {
     var folderNode = (FolderNode) node;
     foreach (var child in folderNode.GetChildren(this))
     {
         _nodes[child.Id] = child;
         yield return child;
     }
 }
 public HierarchyNode AddFolder(HierarchyNode parent, string name, IFolderSource folderSource = null, IMediaItemSource mediaSource = null)
 {
     FolderNode node = CreateFolder(parent, name, folderSource, mediaSource);
     AddChild(parent, node);
     return node;
 }
 public void AddChild(HierarchyNode hierarchyNode)
 {
     _children.Add(hierarchyNode);
 }
 public void AddChild(HierarchyNode node, HierarchyNode child)
 {
     var folderNode = (FolderNode) node;
     folderNode.AddChild(child);
     _nodes[child.Id] = child;
 }
 private FolderNode CreateFolder(HierarchyNode parent, string name, IFolderSource folderSource, IMediaItemSource mediaSource)
 {
     var folder = new FolderNode(parent.Id, CreateId(), name, folderSource: folderSource,
                                 mediaSource: mediaSource);
     _nodes[CreateId()] = folder;
     return folder;
 }