Esempio n. 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);
        }
Esempio n. 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);
            });
        }
Esempio n. 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;
        }
Esempio n. 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);
 }
Esempio n. 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);
                });
        }
Esempio n. 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);
 }