Revision 2341c603 trunk/Pithos.Client.WPF/Utils/EnumerableExtensions.cs

b/trunk/Pithos.Client.WPF/Utils/EnumerableExtensions.cs
102 102

  
103 103
                var parts = item.Name.Split('/');
104 104

  
105
                //Dont't add files
106
                if (!item.IsDirectory)
105
                if (item.IsDirectory)
107 106
                {
107
                    AddParentNodes(lookups, rootNodes, parts, item);
108

  
109
                    //Store each item using its current path
110
                    var newNode = new DirectoryRecord {DisplayName = parts.Last(), ObjectInfo = item};
111
                    AddNode(rootNodes, lookups, newNode);
112
                }
113
                else
114
                {
115
                    //Dont't add files
108 116
                    //But check to ensure that we DO have it's parent on record
109
                    //It it exist
117
                    //If it exist
110 118
                    if (lookups.TryGetValue(parentPath, out parent))
111 119
                    {
112 120
                        //Just continue
......
120 128
                    //Since this is not a directory, we won't add the item itself
121 129
                    AddParentNodes(lookups, rootNodes, parts, item);
122 130
                }
123
                else
124
                {
125
                    AddParentNodes(lookups, rootNodes, parts, item);
126

  
127
                    //Store each item using its current path
128
                    var newNode = new DirectoryRecord {DisplayName = parts.Last(), ObjectInfo = item};
129
                    AddNode(rootNodes, lookups, newNode);
130
                }
131
                
132 131
            }
133 132
            return rootNodes;
134 133
        }

Also available in: Unified diff