Пример #1
0
        void loadDisk(string name)
        {
            treeView1.Nodes.Clear();
            listView1.Items.Clear();
            if (vol != null)
            {
                vol.Close();
            }
            vol = new FATVolume(name);
            treeView1.Nodes.Add(new TreeNode(name.Contains("\\") ? name.Substring(name.LastIndexOf('\\') + 1) : name.Contains("/") ? name.Substring(name.LastIndexOf('/') + 1) : name, 2, 2));
            getDirs(string.Empty, treeView1.Nodes[0]);
            treeView1.Nodes[0].Expand();
            FileInfo fi1 = new FileInfo();

            fi1.TreeNode           = treeView1.Nodes[0];
            fi1.FullPath           = "";
            fi1.FileName           = "";
            treeView1.Nodes[0].Tag = fi1;
            SetDir(fi1);
            Forward = new Stack <string>();
            Back    = new Stack <string>();
            toolStripButtonBack.Enabled           = false;
            toolStripButtonCopy.Enabled           = false;
            toolStripButtonCut.Enabled            = false;
            toolStripButtonDelete.Enabled         = false;
            toolStripButtonForward.Enabled        = false;
            toolStripButtonNewFolder.Enabled      = true;
            toolStripButtonUp.Enabled             = false;
            toolStripButtonDiskProperties.Enabled = true;
            toolStripButtonImport.Enabled         = true;
            toolStripButtonExport.Enabled         = true;
            timer1.Start();
            statusStrip1.Items[1].Text = string.Format("{0} KB free", vol.ComputeFreeSpace() / 1024);
        }