private void ClearAllBtn_Click(System.Object sender, System.EventArgs e) { FileListTxt.BeginUpdate(); for (int i = 0; i < FileListTxt.Items.Count; i++) { FileListTxt.SetSelected(i, false); } FileListTxt.EndUpdate(); }
/// <summary> Constructor </summary> /// <param name="foundFiles">A list of files found on disk.</param> public FITSFound(string[] foundFiles) { InitializeComponent(); FOUNDFILES = foundFiles; this.Text = "Found " + FOUNDFILES.Length.ToString() + " files..."; NumFilesTxt.Text = "Please Select File(s)..."; FileListTxt.BeginUpdate(); FileListTxt.Items.AddRange(FOUNDFILES); FileListTxt.EndUpdate(); }
/// <summary> Constructor </summary> /// <param name="fullFileNameFoundList">A FITSFound list filename containing the list of FITS files, beginning with the number of files (lines) as the first line of the file.</param> public FITSFound(string fullFileNameFoundList) { InitializeComponent(); FileStream fs2 = new FileStream(fullFileNameFoundList, System.IO.FileMode.Open, FileAccess.Read); StreamReader sr2 = new StreamReader(fs2); int numlines = System.Convert.ToInt32(sr2.ReadLine()); FOUNDFILES = new string[numlines]; for (int i = 0; i < numlines; i++) { FOUNDFILES[i] = sr2.ReadLine(); } sr2.Close(); fs2.Close(); this.Text = "Found " + FOUNDFILES.Length.ToString() + " files..."; NumFilesTxt.Text = "Please Select File(s)..."; FileListTxt.BeginUpdate(); FileListTxt.Items.AddRange(FOUNDFILES); FileListTxt.EndUpdate(); }