예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
            });
        }
예제 #3
0
        /// <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;
        }
예제 #4
0
 /// <summary>
 /// The remove phone.
 /// </summary>
 /// <param name="locationPhone">
 /// The location phone.
 /// </param>
 public virtual void RemovePhone(LocationPhone locationPhone)
 {
     _phoneNumbers.Delete(locationPhone);
     NotifyItemRemoved(() => PhoneNumbers, locationPhone);
 }
예제 #5
0
        /// <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);
                });
        }
예제 #6
0
 /// <summary>
 /// The remove phone.
 /// </summary>
 /// <param name="locationPhone">
 /// The location phone.
 /// </param>
 public virtual void RemovePhone(LocationPhone locationPhone)
 {
     _phoneNumbers.Delete(locationPhone);
     NotifyItemRemoved(() => PhoneNumbers, locationPhone);
 }