/// <summary> /// Raises the event on the handler passed in with default empty arguments /// </summary> /// <param name="handler">The handler.</param> /// <param name="sender">The sender.</param> public static void RaiseEvent(this MemberValueElementRemovedHandler handler, object sender) { if (handler != null) { handler(sender, EventArgs.Empty); } }
/// <summary> /// Raises the event which is represented by the handler specified. /// </summary> /// <typeparam name="T">type of the event args</typeparam> /// <param name="handler">The handler of the event to raise.</param> /// <param name="sender">The sender of the event.</param> /// <param name="arguments">The arguments to pass to the handler.</param> public static void RaiseEvent <T>(this MemberValueElementRemovedHandler handler, object sender, T arguments) where T : System.EventArgs { if (handler != null) { handler(sender, arguments); } }
/// <summary> /// Initializes a new instance of the <see cref="CommandifiedMember<TValue, TChangeType>"/> 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; _setValueDescription = "Set a new value to: " + _memberName; _sharedValueChangedHandler = _memberValue_ElementChanged; _sharedValueRemovedHandler = _memberValue_ElementRemoved; BindToElementChanged(); BindToElementRemoved(); }