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