Exemple #1
0
 public MyKontrol(IContainer container)
 {
     container.Add(this);
     InitializeComponent();
     dataGridView1.Columns.Add(Name, "Name");
     dataGridView1.Columns.Add(Name, "Size");
     dataGridView1.Dock=DockStyle.Bottom;
     CreateDiskBut();
     var flFile=new Folder(@"C:\");
     flFile.Open();
     foreach (var l in flFile.DirectoriesList)
     {
         dataGridView1.Rows.Add(l.Name, l.Path);
     }
     foreach (var l in flFile.FilesList)
     {
         dataGridView1.Rows.Add(l.Name,l.Size);
     }
 }
Exemple #2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int y = dataGridView1.CurrentCell.RowIndex;
            string c = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            var flFile = new Folder(c);
              try
            {

                flFile.Open();
                dataGridView1.Rows.Clear();
                foreach (var l in flFile.DirectoriesList)
                {
                    dataGridView1.Rows.Add(l.Name, l.Path);
                }
                foreach (var l in flFile.FilesList)
                {
                    dataGridView1.Rows.Add(l.Name, l.Size);
                }

            }
            catch (Exception)
            {

                var flfiles = new File(flFile.Path);
                flfiles.Open();
            }
        }
Exemple #3
0
 public void openDir(string d)
 {
     string c = d;
     //var fales = new Files { Per = c };
     //fales = new Files {Per = c};
     //dataGridView1.Rows.Clear();
     //foreach (var l in fales._information())
     //{
     //    dataGridView1.Rows.Add(fales.Name, fales.Size);
     //}
     dataGridView1.Rows.Clear();
     Folder flFile = new Folder(c);
     flFile.Open();
     foreach (var l in flFile.DirectoriesList)
     {
         dataGridView1.Rows.Add(l.Name, l.Path);
     }
     foreach (var l in flFile.FilesList)
     {
         dataGridView1.Rows.Add(l.Name, l.Size);
     }
 }