Ejemplo n.º 1
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="staffLanguage">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual(StaffLanguage staffLanguage)
        {
            if (staffLanguage == null)
            {
                return(false);
            }

            var valuesEqual = Equals(_language.Key, staffLanguage._language.Key) &&
                              Equals(_languageFluency.Key, staffLanguage._languageFluency.Key);

            return(valuesEqual);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the language.
        /// </summary>
        /// <param name="language">
        /// The language.
        /// </param>
        public virtual void AddLanguage(StaffLanguage language)
        {
            Check.IsNotNull(language, "Language is required.");

            DomainRuleEngine.CreateRuleEngine <Staff, StaffLanguage> (this, () => AddLanguage)
            .WithContext(language)
            .Execute(() =>
            {
                language.Staff = this;
                _languages.Add(language);
                NotifyItemAdded(() => Languages, language);
            });
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the language.
 /// </summary>
 /// <param name="language">
 /// The language.
 /// </param>
 public virtual void RemoveLanguage( StaffLanguage language )
 {
     Check.IsNotNull ( language, "Language is required." );
     _languages.Remove ( language );
     NotifyItemRemoved ( () => Languages, language );
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds the language.
        /// </summary>
        /// <param name="language">
        /// The language.
        /// </param>
        public virtual void AddLanguage( StaffLanguage language )
        {
            Check.IsNotNull ( language, "Language is required." );

            DomainRuleEngine.CreateRuleEngine<Staff, StaffLanguage> ( this, () => AddLanguage )
                .WithContext ( language )
                .Execute(() =>
                {
                    language.Staff = this;
                    _languages.Add(language);
                    NotifyItemAdded(() => Languages, language);
                });
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Removes the language.
 /// </summary>
 /// <param name="language">
 /// The language.
 /// </param>
 public virtual void RemoveLanguage(StaffLanguage language)
 {
     Check.IsNotNull(language, "Language is required.");
     _languages.Remove(language);
     NotifyItemRemoved(() => Languages, language);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Determines if the values are equal.
        /// </summary>
        /// <param name="staffLanguage">
        /// The other object.
        /// </param>
        /// <returns>
        /// A boolean denoting equality of the values.
        /// </returns>
        public virtual bool ValuesEqual( StaffLanguage staffLanguage )
        {
            if ( staffLanguage == null )
            {
                return false;
            }

            var valuesEqual = Equals ( _language.Key, staffLanguage._language.Key )
                              && Equals ( _languageFluency.Key, staffLanguage._languageFluency.Key );
            return valuesEqual;
        }