コード例 #1
0
        private void btnAddAll_Click(object sender, EventArgs e)
        {
            using (var form = new InputDirectoryForm("Input folder", "Folder", ""))
            {
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    List <string> findFiles = FileUtils.GetFiles(form.Value, "*.dtas", true);
                    foreach (string findFile in findFiles)
                    {
                        if (lbDtaFiles.Items.Contains(findFile))
                        {
                            continue;
                        }

                        lbDtaFiles.Items.Add(findFile);
                    }

                    findFiles = FileUtils.GetFiles(form.Value, "*.dtas.zip", true);
                    foreach (string findFile in findFiles)
                    {
                        if (lbDtaFiles.Items.Contains(findFile))
                        {
                            continue;
                        }

                        lbDtaFiles.Items.Add(findFile);
                    }
                }
            }
        }
コード例 #2
0
 private void btnAddSubDirectories_Click(object sender, EventArgs e)
 {
     using (var form = new InputDirectoryForm("Input folder", "Folder", ""))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             string[] dirs = Directory.GetDirectories(form.Value);
             this.dataDirs.AddDirectories(dirs);
         }
     }
 }
コード例 #3
0
 private void btnAddSubDirectories_Click(object sender, EventArgs e)
 {
     using (var form = new InputDirectoryForm("Input folder", "Folder", ""))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             var files = new DirectoryInfo(form.Value).GetFiles("*.log");
             foreach (var file in files)
             {
                 if (!lvFiles.Items.ContainsKey(file.FullName))
                 {
                     lvFiles.Items.Add(file.FullName);
                 }
             }
         }
     }
 }