private void SaveFilePatterns(FilePatternList Patterns, DataGridView Source) { Patterns.Clear(); for (int r = 0; r < Source.Rows.Count; r++) { Patterns.Add(new FilePattern((string)Source[0, r].Value)); } }
private void LoadFilePatterns(FilePatternList Patterns, DataGridView Destination) { foreach (FilePattern FP in Patterns) { int RowIndex = Destination.Rows.Add(); Destination[0, RowIndex].Value = FP.Pattern; Destination[1, RowIndex].Value = (FP.IsValid ? "OK" : "Invalid file pattern"); } Destination.ClearSelection(); Destination.Refresh(); }