Пример #1
0
        /// <summary>
        /// Deletes the reaction.
        /// </summary>
        /// <param name="allergyReaction">The allergy reaction.</param>
        public virtual void DeleteReaction(AllergyReaction allergyReaction)
        {
            Check.IsNotNull(allergyReaction, "allergyReaction is required.");

            _allergyReactions.Delete(allergyReaction);
            NotifyItemRemoved(() => AllergyReactions, allergyReaction);
        }
Пример #2
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="allergyReaction">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(AllergyReaction allergyReaction)
        {
            if (allergyReaction == null)
            {
                return(false);
            }

            var valuesEqual =
                Equals(Allergy.Key, allergyReaction.Key) &&
                Equals(Reaction.Key, allergyReaction.Key);

            return(valuesEqual);
        }
Пример #3
0
        /// <summary>
        /// Adds the reaction.
        /// </summary>
        /// <param name="reaction">The reaction.</param>
        /// <returns>An AllergyReaction.
        /// </returns>
        public virtual AllergyReaction AddReaction(Reaction reaction)
        {
            Check.IsNotNull(reaction, "reaction is required.");

            var allergyReaction = new AllergyReaction(reaction)
            {
                Allergy = this
            };

            _allergyReactions.Add(allergyReaction);
            NotifyItemAdded(() => AllergyReactions, allergyReaction);

            return(allergyReaction);
        }
Пример #4
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="allergyReaction">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>         
        public virtual bool ValuesEqual( AllergyReaction allergyReaction )
        {
            if (allergyReaction == null)
            {
                return false;
            }

            var valuesEqual =
                Equals ( Allergy.Key, allergyReaction.Key ) &&
                Equals ( Reaction.Key, allergyReaction.Key );

            return valuesEqual;
        }
Пример #5
0
        /// <summary>
        /// Deletes the reaction.
        /// </summary>
        /// <param name="allergyReaction">The allergy reaction.</param>
        public virtual void DeleteReaction( AllergyReaction allergyReaction )
        {
            Check.IsNotNull(allergyReaction, "allergyReaction is required.");

            _allergyReactions.Delete ( allergyReaction);
            NotifyItemRemoved ( () => AllergyReactions, allergyReaction );
        }
Пример #6
0
        /// <summary>
        /// Adds the reaction.
        /// </summary>
        /// <param name="reaction">The reaction.</param>
        /// <returns>An AllergyReaction.
        /// </returns>
        public virtual AllergyReaction AddReaction( Reaction reaction )
        {
            Check.IsNotNull ( reaction, "reaction is required." );

            var allergyReaction = new AllergyReaction ( reaction ) { Allergy = this };
            _allergyReactions.Add ( allergyReaction );
            NotifyItemAdded ( () => AllergyReactions, allergyReaction );

            return allergyReaction;
        }