예제 #1
0
        /// <summary>
        /// Quietly removes an address from the collection that matches the existing address type
        /// </summary>
        /// <param name="phoneNumber"></param>
        private void RemoveExistingPhoneNumber(EntityPhoneNumber phoneNumber)
        {
            EntityPhoneNumber existingPhone = GetPhoneNumberByType(phoneNumber.Type.Guid);

            if (existingPhone != null)
                RemovePhoneNumber(existingPhone);
        }
예제 #2
0
 /// <summary>
 /// Removes an EntityPhoneNumber from this entity
 /// </summary>
 /// <param name="phoneNumber">EntityPhoneNumber to remove</param>
 /// <remarks>This method wraps <see cref="List&lt;T&gt;.Remove"/>.</remarks>
 public void RemovePhoneNumber(EntityPhoneNumber phoneNumber)
 {
     PhoneNumbers.Remove(phoneNumber);
 }
예제 #3
0
 /// <summary>
 /// Gets the index of a particular EntityPhoneNumber
 /// </summary>
 /// <param name="phoneNumber">EntityPhoneNumber to get the index of</param>
 /// <returns>The index of the specified EntityPhoneNumber</returns>
 /// <remarks>This method wraps <see cref="IList&lt;T&gt;.IndexOf"/>.</remarks>
 public int GetIndexOfPhoneNumber(EntityPhoneNumber phoneNumber)
 {
     return PhoneNumbers.IndexOf(phoneNumber);
 }
예제 #4
0
 /// <summary>
 /// Inserts an EntityPhoneNumber into the EntityPhoneNumber collection.
 /// </summary>
 /// <param name="index">The index to insert the <paramref name="phoneNumber"/> into.</param>
 /// <param name="phoneNumber">The EntityPhoneNumber to insert into the collection.</param>
 /// <remarks>This method wraps <see cref="List&lt;T&gt;.Insert"/>.</remarks>
 public void InsertPhoneNumber(int index, EntityPhoneNumber phoneNumber)
 {
     // IMPORTANT!!! MAKE SURE that you put any logic that you place into this method
     // into the AddPhoneNumber method as well!!!!
     RemoveExistingPhoneNumber(phoneNumber);
     PhoneNumbers.Insert(index, phoneNumber);
 }
예제 #5
0
 /// <summary>
 /// Checks to see whether an EntityPhoneNumber exists in the
 /// EntityPhoneNumber collection
 /// </summary>
 /// <param name="phoneNumber">EntityPhoneNumber to check</param>
 /// <returns>True if the EntityPhoneNumber exists, false if not</returns>
 /// <remarks>This method wraps <see cref="List&lt;T&gt;.Contains"/>.</remarks>
 public bool ContainsPhoneNumber(EntityPhoneNumber phoneNumber)
 {
     return PhoneNumbers.Contains(phoneNumber);
 }