Пример #1
0
        private void save_Click(object sender, EventArgs e)
        {
            var people = AttendeeCollection.Create();

            foreach (var person in textBox1.Lines)
            {
                if (!string.IsNullOrWhiteSpace(person))
                {
                    people.Add(new Attendee {
                        Name = person
                    });
                }
            }

            using (var fs = File.Open(Path.Combine(GetSetting("FileLocation"), "Attendees.xml"), FileMode.Truncate, FileAccess.Write))
            {
                new XmlSerializer(typeof(AttendeeCollection)).Serialize(fs, people);
            }
        }
Пример #2
0
 protected override IThingCollection <IAttendee> GetCollection()
 {
     return(AttendeeCollection.Create());
 }