private void Populate(TreeNode parent, JungleDiskBucket bucket, string path) { TreeNode node; DirectoryContents contents = null; try { contents = conn.GetDirectoryListing(bucket, path); } catch (Exception ex) { return; } foreach (DirectoryItem item in contents.SortedDirectories) { node = parent.Nodes.Add(item.Name); node.ImageIndex = imgFolder; node.Tag = item; node.Nodes.Add("."); } foreach (DirectoryItem item in contents.SortedFiles) { node = parent.Nodes.Add(item.Name); node.ImageIndex = imgFile; node.Tag = item; } }
private void bucketSelectionBox_SelectedIndexChanged(object sender, EventArgs e) { bucket = buckets[bucketSelectionBox.SelectedIndex]; if (bucket == null) { return; } treeView.Nodes.Clear(); TreeNode root = treeView.Nodes.Add(bucket.DisplayName); root.ImageIndex = imgBucket; root.Tag = null; Populate(root, bucket, "/"); buttonDownload.Enabled = false; buttonUpload.Enabled = false; buttonDelete.Enabled = false; }
private static int CompareBuckets(JungleDiskBucket a, JungleDiskBucket b) { return(a.DisplayName.CompareTo(b.DisplayName)); }
private static int CompareBuckets(JungleDiskBucket a, JungleDiskBucket b) { return a.DisplayName.CompareTo(b.DisplayName); }
private void bucketSelectionBox_SelectedIndexChanged(object sender, EventArgs e) { bucket = buckets[bucketSelectionBox.SelectedIndex]; if (bucket == null) return; treeView.Nodes.Clear(); TreeNode root = treeView.Nodes.Add(bucket.DisplayName); root.ImageIndex = imgBucket; root.Tag = null; Populate(root, bucket, "/"); buttonDownload.Enabled = false; buttonUpload.Enabled = false; buttonDelete.Enabled = false; }