/// <summary> /// Determines if the values are equal. /// </summary> /// <param name="other"> /// The other object. /// </param> /// <returns> /// A boolean denoting equality of the values. /// </returns> public virtual bool ValuesEqual(LocationPhone other) { if (other == null) { return(false); } var valuesEqual = Equals(_phone, other.Phone) && Equals(_locationPhoneType, other.LocationPhoneType); return(valuesEqual); }
/// <summary> /// The add phone. /// </summary> /// <param name="locationPhone"> /// The location phone. /// </param> public virtual void AddPhone(LocationPhone locationPhone) { Check.IsNotNull(locationPhone, "locationPhone is required."); DomainRuleEngine.CreateRuleEngine <Location, LocationPhone> (Location, () => AddPhone) .WithContext(locationPhone) .WithContext(this) .Execute(() => { locationPhone.LocationAddressAndPhone = this; _phoneNumbers.Add(locationPhone); NotifyItemAdded(() => PhoneNumbers, locationPhone); }); }
/// <summary> /// Determines if the values are equal. /// </summary> /// <param name="other"> /// The other object. /// </param> /// <returns> /// A boolean denoting equality of the values. /// </returns> public virtual bool ValuesEqual(LocationPhone other) { if (other == null) { return false; } var valuesEqual = Equals(_phone, other.Phone) && Equals(_locationPhoneType, other.LocationPhoneType); return valuesEqual; }
/// <summary> /// The remove phone. /// </summary> /// <param name="locationPhone"> /// The location phone. /// </param> public virtual void RemovePhone(LocationPhone locationPhone) { _phoneNumbers.Delete(locationPhone); NotifyItemRemoved(() => PhoneNumbers, locationPhone); }
/// <summary> /// The add phone. /// </summary> /// <param name="locationPhone"> /// The location phone. /// </param> public virtual void AddPhone(LocationPhone locationPhone) { Check.IsNotNull(locationPhone, "locationPhone is required."); DomainRuleEngine.CreateRuleEngine<Location, LocationPhone> ( Location, () => AddPhone ) .WithContext ( locationPhone ) .WithContext ( this ) .Execute(() => { locationPhone.LocationAddressAndPhone = this; _phoneNumbers.Add(locationPhone); NotifyItemAdded(() => PhoneNumbers, locationPhone); }); }