/// <summary> /// Fill the list with membership data from the Membership data file using the GetMemberships /// method of the MembershipData class /// </summary> /// <param name="path"></param> public void write(string path) { string[] lines = MembershipData.GetMemberships(path); string[] data; char[] delimiterChars = { ' ', ',', '-', }; foreach (string s in lines) { data = s.Split(delimiterChars); add(new Member(data[0], data[1], data[4])); } }
/// <summary> /// Saves the memberships to a file using the SaveMemberships method of the MembershipData class /// </summary> /// <param name="path">the directory of the data file</param> public void save(string path) { //ArrayList export = new ArrayList(); string[] export = new string[listOfMembers.Count]; int i = 0; foreach (Member m in listOfMembers) { export[i] = (m.getDisplayText()); i++; } //save to file MembershipData.SaveMemberships(path, export); }