Ejemplo n.º 1
0
 /// <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);
     }
 }
Ejemplo n.º 2
0
		/// <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;
		}
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 /// <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);
		}
Ejemplo n.º 6
0
        /// <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);
            }
        }
Ejemplo n.º 7
0
		/// <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);
		}
Ejemplo n.º 8
0
		/// <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));			
		}