public System.Collections.IEnumerable GetChildren(TreePath treePath)
            {
                if (treePath.IsEmpty())
                {
                    var list = _resSvc.EnumerateUnmanagedData(null, null, false, OSGeo.MapGuide.MaestroAPI.UnmanagedDataTypes.Folders);
                    foreach (var item in list.Items)
                    {
                        if (typeof(UnmanagedDataListUnmanagedDataFolder).IsAssignableFrom(item.GetType()))
                        {
                            var folder = (UnmanagedDataListUnmanagedDataFolder)item;

                            yield return(new FolderModel(folder));
                        }
                    }
                }
                else
                {
                    var mdl = treePath.LastNode as FolderModel;
                    if (mdl != null)
                    {
                        var folder = mdl.Tag;
                        if (folder.NumberOfFolders > 0)
                        {
                            var list = _resSvc.EnumerateUnmanagedData(folder.UnmanagedDataId, null, false, OSGeo.MapGuide.MaestroAPI.UnmanagedDataTypes.Folders);
                            foreach (var item in list.Items)
                            {
                                if (typeof(UnmanagedDataListUnmanagedDataFolder).IsAssignableFrom(item.GetType()))
                                {
                                    var fl = (UnmanagedDataListUnmanagedDataFolder)item;

                                    yield return(new FolderModel(fl));
                                }
                            }
                        }
                    }
                }
            }
 private void trvFolders_SelectionChanged(object sender, EventArgs e)
 {
     if (trvFolders.SelectedNode != null)
     {
         var mdl = trvFolders.SelectedNode.Tag as FolderModel;
         if (mdl != null)
         {
             if (this.SelectFoldersOnly)
             {
                 txtItem.Text = mdl.Tag.UnmanagedDataId;
                 return;
             }
             else
             {
                 //TODO: file filter
                 var list = _resSvc.EnumerateUnmanagedData(mdl.Tag.UnmanagedDataId, null, false, OSGeo.MapGuide.MaestroAPI.UnmanagedDataTypes.Files);
                 PopulateFileList(list);
             }
         }
     }
 }