internal static string GetValue(AttendeeCollection attendees, bool singleOut)
        {
            if (attendees == null)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Length: {0}", attendees.Count));
            sb.AppendLine();

            int i = 0;

            foreach (Attendee attendee in attendees)
            {
                sb.AppendLine(string.Format(System.Globalization.CultureInfo.CurrentCulture, "Attendee [{0}]", i));
                sb.AppendLine(AttendeeTypeValue.GetValue(attendee, true));
                sb.AppendLine();
                sb.AppendLine();
                i++;
            }

            return(sb.ToString());
        }
        public string GetValue(object ownerInstance, PropertyInfo propInfo)
        {
            string text = string.Empty;

            AttendeeCollection attendees = propInfo.GetValue(ownerInstance, null) as AttendeeCollection;

            return(GetValue(attendees, false));
        }
Exemple #3
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);
            }
        }
Exemple #4
0
        private string GetAttendees(AttendeeCollection attendees)
        {
            if (attendees.Count == 0)
            {
                return("none");
            }

            string sAttendees = "";

            foreach (Attendee attendee in attendees)
            {
                if (!String.IsNullOrEmpty(sAttendees))
                {
                    sAttendees += ", ";
                }
                sAttendees += attendee.Name;
            }

            return(sAttendees);
        }
Exemple #5
0
        private static string GetAttendeeNamesAndResponse(AttendeeCollection attendees)
        {
            var nameList = new List <string>();

            foreach (var attendee in attendees)
            {
                var s = attendee.Name + " -> ";

                if (attendee.ResponseType.HasValue)
                {
                    s += attendee.ResponseType.Value.ToString();
                }
                else
                {
                    s += "None";
                }

                nameList.Add(s);
            }

            return(string.Join(",", nameList));
        }
Exemple #6
0
        private void configForm_Load(object sender, EventArgs e)
        {
            var swags = SwagCollection.Load(GetPathFor("Swag.xml"));

            foreach (var swag in swags)
            {
                var newRow = new DataGridViewRow();
                newRow.Cells.Add(new DataGridViewTextBoxCell {
                    Value = swag.Company
                });
                newRow.Cells.Add(new DataGridViewTextBoxCell {
                    Value = swag.Thing
                });
                swagGrid.Rows.Add(newRow);
            }

            var people = AttendeeCollection.Load(GetPathFor("Attendees.xml"));

            foreach (var person in people)
            {
                textBox1.AppendText(person.Name + Environment.NewLine);
            }
        }
Exemple #7
0
 protected override IThingCollection <IAttendee> GetCollection()
 {
     return(AttendeeCollection.Create());
 }
Exemple #8
0
 protected override IList <IAttendee> LoadThings(string thingLocation)
 {
     return(AttendeeCollection.Load(thingLocation));
 }