/// <summary> /// Initializes a new instance of the AddressBook class /// </summary> /// <param name="name">The name to give the address book</param> /// <param name="description">A description to give the address book</param> /// <param name="addresses">A list of addresses to give the address</param> public AddressBook(string name, string description, AddressBookItemList addresses) : this(name, description) { foreach (AddressBookItem address in this.Items) { this.Items.Add(address); } }
/// <summary> /// Initializes a new instance of the AddressBook class /// </summary> public AddressBook() { _id = Guid.NewGuid().ToString(); _items = new AddressBookItemList(); _items.Changed += new AddressingEventHandler(this.OnChanged); _items.Parent = this; }
/// <summary> /// Deserializes the address book /// </summary> /// <param name="info"></param> /// <param name="context"></param> public AddressBook(SerializationInfo info, StreamingContext context) : this() { _id = (string)info.GetValue("Id", typeof(string)); _name = (string)info.GetValue("Name", typeof(string)); _description = (string)info.GetValue("Description", typeof(string)); _items = (AddressBookItemList)info.GetValue("Items", typeof(AddressBookItemList)); }
/// <summary> /// Initializes a new instance of the AddressBookItemList class /// </summary> /// <param name="list">The list to copy</param> public AddressBookItemList(AddressBookItemList list) : this() { if (list == null) throw new ArgumentNullException("AddressBookItemList", "A null reference to a AddressBookItemList cannot be used to create a new list."); foreach(AddressBookItem item in list) this.Add(item); }
/// <summary> /// Initializes a new instance of the AddressBookItemList class /// </summary> /// <param name="list">The list to copy</param> public AddressBookItemList(AddressBookItemList list) : this() { if (list == null) { throw new ArgumentNullException("AddressBookItemList", "A null reference to a AddressBookItemList cannot be used to create a new list."); } foreach (AddressBookItem item in list) { this.Add(item); } }
/// <summary> /// Initializes a new instance of the AddressBook class /// </summary> /// <param name="name">The name to give the address book</param> /// <param name="description">A description to give the address book</param> /// <param name="addresses">A list of addresses to give the address</param> public AddressBook(string name, string description, AddressBookItemList addresses) : this(name, description) { foreach(AddressBookItem address in this.Items) this.Items.Add(address); }