コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandifiedMember&lt;TValue, TChangeType&gt;"/> class.
 /// </summary>
 /// <param name="memberName">Name of the member.</param>
 /// <param name="changeTypeValueToUse">The change type value to use.</param>
 /// <param name="loggedErrors">container for error messages. Can be null.</param>
 public CommandifiedMember(string memberName, TChangeType changeTypeValueToUse, ErrorContainer loggedErrors)
     : this(memberName, changeTypeValueToUse, loggedErrors, default(TValue))
 {
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandifiedMember&lt;TValue, TChangeType&gt;"/> class.
 /// </summary>
 /// <param name="memberName">Name of the member.</param>
 /// <param name="changeTypeValueToUse">The change type value to use.</param>
 /// <param name="loggedErrors">The logged errors container.</param>
 /// <param name="initialValue">The initial value.</param>
 public CommandifiedMember(string memberName, TChangeType changeTypeValueToUse, ErrorContainer loggedErrors, TValue initialValue)
 {
     if (string.IsNullOrEmpty(memberName))
     {
         throw new ArgumentException("memberName has to have a value");
     }
     _loggedErrors         = loggedErrors;
     _changeTypeValueToUse = changeTypeValueToUse;
     _memberName           = memberName;
     _memberValue          = initialValue;
     this.ThrowExceptionOnValidationError = true;
     BindToElementChanged();
     BindToElementRemoved();
 }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommandifiedMember&lt;TValue, TChangeType&gt;"/> class.
        /// </summary>
        /// <param name="memberName">Name of the member.</param>
        /// <param name="changeTypeValueToUse">The change type value to use.</param>
        /// <param name="loggedErrors">The logged errors container.</param>
        /// <param name="initialValue">The initial value.</param>
        public CommandifiedMember(string memberName, TChangeType changeTypeValueToUse, ErrorContainer loggedErrors, TValue initialValue)
        {
            ArgumentVerifier.ShouldBeTrue((s) => !String.IsNullOrEmpty(memberName), memberName, "memberName has to have a value");
            _loggedErrors         = loggedErrors;
            _changeTypeValueToUse = changeTypeValueToUse;
            _memberName           = memberName;
            _memberValue          = initialValue;
            this.ThrowExceptionOnValidationError = true;
            _setValueDescription = "Set a new value to '" + _memberName + "'";

            BindToElementChanged();
            BindToElementRemoved();
        }