/// <summary> /// Add new email address to the collection. /// </summary> /// <param name="type">Email address type. Note: This value can be flagged value !</param> /// <param name="email">Email address.</param> public EmailAddress Add(EmailAddressType_enum type, string email) { Item item = m_pOwner.Items.Add("EMAIL", EmailAddress.EmailTypeToString(type), ""); item.SetDecodedValue(email); EmailAddress emailAddress = new EmailAddress(item, type, email); m_pCollection.Add(emailAddress); return(emailAddress); }
/// <summary> /// This method is called when some property has changed, we need to update underlaying vCard item. /// </summary> private void Changed() { string value = "" + m_PostOfficeAddress + ";" + m_ExtendedAddress + ";" + m_Street + ";" + m_Locality + ";" + m_Region + ";" + m_PostalCode + ";" + m_Country; m_pItem.ParametersString = AddressTypeToString(m_Type); m_pItem.SetDecodedValue(value); }
/// <summary> /// Add new delivery address to the collection. /// </summary> /// <param name="type">Delivery address type. Note: This value can be flagged value !</param> /// <param name="postOfficeAddress">Post office address.</param> /// <param name="extendedAddress">Extended address.</param> /// <param name="street">Street name.</param> /// <param name="locality">Locality(city).</param> /// <param name="region">Region.</param> /// <param name="postalCode">Postal code.</param> /// <param name="country">Country.</param> public void Add(DeliveryAddressType_enum type, string postOfficeAddress, string extendedAddress, string street, string locality, string region, string postalCode, string country) { string value = "" + postOfficeAddress + ";" + extendedAddress + ";" + street + ";" + locality + ";" + region + ";" + postalCode + ";" + country; Item item = m_pOwner.Items.Add("ADR", DeliveryAddress.AddressTypeToString(type), ""); item.SetDecodedValue(value); m_pCollection.Add(new DeliveryAddress(item, type, postOfficeAddress, extendedAddress, street, locality, region, postalCode, country)); }
/// <summary> /// Sets first item with specified value. If item doesn't exist, item will be appended to the end. /// If value is null, all items with specified name will be removed. /// Value is encoed as needed and specified item.ParametersString will be updated accordingly. /// </summary> /// <param name="name">Item name.</param> /// <param name="value">Item value.</param> public void SetDecodedValue(string name, string value) { if (value == null) { Remove(name); return; } Item item = GetFirst(name); if (item != null) { item.SetDecodedValue(value); } else { item = new Item(name, "", ""); m_pItems.Add(item); item.SetDecodedValue(value); } }
/// <summary> /// Sets first item with specified value. If item doesn't exist, item will be appended to the end. /// If value is null, all items with specified name will be removed. /// Value is encoed as needed and specified item.ParametersString will be updated accordingly. /// </summary> /// <param name="name">Item name.</param> /// <param name="value">Item value.</param> public void SetDecodedValue(string name,string value) { if(value == null){ Remove(name); return; } Item item = GetFirst(name); if(item != null){ item.SetDecodedValue(value); } else{ item = new Item(m_pCard,name,"",""); m_pItems.Add(item); item.SetDecodedValue(value); } }
/// <summary> /// This method is called when some property has changed, wee need to update underlaying vCard item. /// </summary> private void Changed() { m_pItem.ParametersString = EmailTypeToString(m_Type); m_pItem.SetDecodedValue(m_EmailAddress); }