static string GetBooleandListFileName() { string userPath = AgeGradingForm.GetFolderPath(); const string name = "BOOLEAN LISTS"; string fileName = String.Format("{0}{1}{2}.{3}", userPath, Path.DirectorySeparatorChar, name, "TXT"); return(fileName); }
protected override void OnLoad(EventArgs e) { try { Point location = this.Location; Size size = this.Size; FormWindowState state = this.WindowState; AgeGradingForm.GetPositionInformation(this.Name, ref location, ref size, ref state); this.Location = location; this.Size = size; if (state != FormWindowState.Minimized) { this.WindowState = state; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } base.OnLoad(e); if (String.IsNullOrEmpty(MissingMembersFile) || !File.Exists(MissingMembersFile)) { MessageBox.Show(this, "Invalid or non-existent Missing Member Names File", "Error"); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; return; } if (String.IsNullOrEmpty(AgeColumnName)) { MessageBox.Show(this, "Invalid or non-existent Age Column text", "Error"); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; return; } if (String.IsNullOrEmpty(NameColumnName)) { MessageBox.Show(this, "Invalid or non-existent Name Column text", "Error"); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; return; } if (AgeGradedResults == null) { MessageBox.Show(this, "Invalid or non-existent Age Graded Results Table", "Error"); this.DialogResult = System.Windows.Forms.DialogResult.Cancel; return; } labelMissingMembers.Left = splitContainer.Left + splitContainer.SplitterDistance; dataGridView.DataSource = this.AgeGradedResults; foreach (DataGridViewColumn column in dataGridView.Columns) { if (0 == String.Compare(column.Name, NameColumnName, true) || 0 == String.Compare(column.Name, AgeColumnName, true)) { continue; } column.Visible = false; } RestartAgeGroup = true; FillMissingMemberTable(); }
private void FillMissingMemberTable() { string fileName = Path.GetFileNameWithoutExtension(MissingMembersFile); labelMissingMembers.Text = String.Format(labelMissingMembers.Text, fileName); string[] textLines = System.IO.File.ReadAllLines(MissingMembersFile); if (textLines == null || textLines.Length <= 0) { return; } AgeGradeTextReader reader = new AgeGradeTextReader(); List <List <string> > lines = lines = reader.GetDelimitedLines(textLines, 1, 1, "\t"); if (lines == null || lines.Count <= 0) { return; } DataTable table = new DataTable(); AgeGradingForm.AddDataColumn(table, NameColumnName, typeof(string)); AgeGradingForm.AddDataColumn(table, AgeColumnName, typeof(int)); foreach (List <string> line in lines) { if (line == null || line.Count < 2) { continue; } string name = line[0]; if (!Valid(ref name)) { continue; } if (name.StartsWith("SID", StringComparison.OrdinalIgnoreCase)) { } name = CapitalizeName(name); string ageString = line[1]; if (!Valid(ref ageString)) { continue; } int age = 0; if (!int.TryParse(ageString, out age)) { continue; } DataRow dataRow = table.NewRow(); dataRow[0] = name; dataRow[1] = age; table.Rows.Add(dataRow); } dataGridViewMissingMembers.DataSource = table; }
protected override void OnResizeEnd(EventArgs e) { base.OnResizeEnd(e); AgeGradingForm.SavePositionInformation(this.Name, this.Location, this.Size, this.WindowState); }