Преглед на файлове

Fixed returning subdirectory duplicates in example

tznind преди 4 години
родител
ревизия
4047154eec
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      Terminal.Gui/Views/TreeView.cs
  2. 1 1
      UICatalog/Scenarios/TreeViewFileSystem.cs

+ 1 - 1
Terminal.Gui/Views/TreeView.cs

@@ -375,7 +375,7 @@ namespace Terminal.Gui {
 		public virtual void FetchChildren()
 		{
 			if (tree.ChildrenGetter == null)
-			return;
+				return;
 
 			this.ChildBranches = tree.ChildrenGetter(this.Model).ToDictionary(k=>k,val=>new Branch(tree,this,val));
 		}

+ 1 - 1
UICatalog/Scenarios/TreeViewFileSystem.cs

@@ -85,7 +85,7 @@ namespace UICatalog.Scenarios {
 			// If it is a directory it's children are all contained files and dirs
 			if(model is DirectoryInfo d) {
 				try {
-					return d.GetDirectories().Cast<object>().Union(d.GetFileSystemInfos());
+					return d.GetFileSystemInfos();
 				}
 				catch(SystemException ex) {
 					return new []{ex};