public override IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         yield return root;
     }
     else if (treePath.LastNode == root)
     {                
         foreach (var pluginDescriptor in PluginDescriptors)
         {
             var pluginNode = new PluginNode(pluginDescriptor);
             root.Nodes.Add(pluginNode);
             foreach (var file in pluginDescriptor.FilePaths)
             {
                 var fullPath = Path.Combine(pluginDescriptor.BaseDirectory.FullName, file);
                 var exists = fileSystem.FileExists(fullPath);
                 pluginNode.Nodes.Add(new FileNode(file, exists));
             }
             yield return pluginNode;
         }
     }
     else if (treePath.LastNode is PluginNode)
     {
         var pluginNode = (PluginNode) treePath.LastNode;
         foreach (var child in pluginNode.Nodes)
         {
             yield return child;
         }
     }
 }
Beispiel #2
0
 public override IEnumerable GetChildren(TreePath treePath)
 {
     if (treePath.IsEmpty())
     {
         yield return(root);
     }
     else if (treePath.LastNode == root)
     {
         foreach (var pluginDescriptor in PluginDescriptors)
         {
             var pluginNode = new PluginNode(pluginDescriptor);
             root.Nodes.Add(pluginNode);
             foreach (var file in pluginDescriptor.FilePaths)
             {
                 var fullPath = Path.Combine(pluginDescriptor.BaseDirectory.FullName, file);
                 var exists   = fileSystem.FileExists(fullPath);
                 pluginNode.Nodes.Add(new FileNode(file, exists));
             }
             yield return(pluginNode);
         }
     }
     else if (treePath.LastNode is PluginNode)
     {
         var pluginNode = (PluginNode)treePath.LastNode;
         foreach (var child in pluginNode.Nodes)
         {
             yield return(child);
         }
     }
 }