Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 private static int CompareBuckets(JungleDiskBucket a, JungleDiskBucket b)
 {
     return(a.DisplayName.CompareTo(b.DisplayName));
 }
        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 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;
        }