FixtureProfiles LoadFixtureProfiles(string[] lines) { FixtureProfiles fixtureProfiles = new FixtureProfiles(); bool fixtureProfilesFound = false; foreach (string line in lines) { if (line.Contains("@FIXTURE PROFILES")) { fixtureProfilesFound = true; } else if (fixtureProfilesFound) { if (string.IsNullOrEmpty(line) && !line.StartsWith("% ") || line.Contains("@DATA")) { break; } else if (!line.StartsWith("% FixtureClass")) { FixtureProfile fixtureProfile = new FixtureProfile(ToStringArray(line, ',')); fixtureProfiles.Add(fixtureProfile); } } } return(fixtureProfiles); }
FixtureProfiles LoadFixtureProfiles(OleDbConnection connection) { FixtureProfiles fixtureProfiles = new FixtureProfiles(); using (OleDbCommand command = new OleDbCommand(BuildLoadFixtureProfilesCommand(), connection)) { using (OleDbDataReader reader = command.ExecuteReader()) { while (reader.Read()) { fixtureProfiles.Add(BuildFixtureProfile(reader).Normalize()); } } } return(fixtureProfiles); }