Modifications to enable Sync Pausing for all operations
[pithos-ms-client] / trunk / Pithos.Client.WPF / Utils / EnumerableExtensions.cs
index 7c3f15c..5e62743 100644 (file)
@@ -102,11 +102,19 @@ namespace Pithos.Client.WPF.Utils
 
                 var parts = item.Name.Split('/');
 
-                //Dont't add files
-                if (!item.IsDirectory)
+                if (item.IsDirectory)
                 {
+                    AddParentNodes(lookups, rootNodes, parts, item);
+
+                    //Store each item using its current path
+                    var newNode = new DirectoryRecord {DisplayName = parts.Last(), ObjectInfo = item};
+                    AddNode(rootNodes, lookups, newNode);
+                }
+                else
+                {
+                    //Dont't add files
                     //But check to ensure that we DO have it's parent on record
-                    //It it exist
+                    //If it exist
                     if (lookups.TryGetValue(parentPath, out parent))
                     {
                         //Just continue
@@ -120,15 +128,6 @@ namespace Pithos.Client.WPF.Utils
                     //Since this is not a directory, we won't add the item itself
                     AddParentNodes(lookups, rootNodes, parts, item);
                 }
-                else
-                {
-                    AddParentNodes(lookups, rootNodes, parts, item);
-
-                    //Store each item using its current path
-                    var newNode = new DirectoryRecord {DisplayName = parts.Last(), ObjectInfo = item};
-                    AddNode(rootNodes, lookups, newNode);
-                }
-                
             }
             return rootNodes;
         }