예제 #1
0
        /// <summary>
        /// Called when an <see cref="IError"/> has been removed from the collection.  It handles
        /// finding the <see cref="IField"/> with the given fieldKey and removing the error to the field.
        /// </summary>
        /// <param name="removed">The <see cref="ValidationError"/> being removed.</param>
        private void OnRemoved(ValidationError removed)
        {
            var f = this.fieldList.Find(removed.FieldKey);

            if (f == null)
            {
                return;
            }

            f.ClearError(removed);
        }
예제 #2
0
        /// <summary>
        /// Called when an <see cref="IError"/> has been added to the collection.  It handles
        /// finding the <see cref="IField"/> with the given fieldKey and adding the error to the field.
        /// </summary>
        /// <param name="added">The added.</param>
        private void OnAdded(ValidationError added)
        {
            var f = this.fieldList.Find(added.FieldKey);

            if (f == null)
            {
                Trace.WriteLine("No registered control for validation message {0}", added.Message);
                return;
            }

            f.AttachError(added);
        }