/// <summary> /// Log a <see cref="ValidationError"/> to the <see cref="IErrorLogService"/>. /// </summary> /// <param name="serviceProvider"> /// The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. /// </param> /// <param name="error"> /// The <see cref="ValidationError"/> to log. /// </param> public static void LogError(IServiceProvider serviceProvider, ValidationError error) { if (null == serviceProvider) throw new ArgumentNullException("serviceProvider"); IErrorLogService errorLogService = GetErrorService(serviceProvider); errorLogService.LogError(error); }
public ValidationErrorListViewItem(ValidationError error) : base() { Text = error.InvalidItem.ToString(); this.error = error; node = error.InvalidItem as ConfigurationNode; StateImageIndex = 0; SubItems.Add(error.PropertyName); SubItems.Add(error.Message); SubItems.Add(node.Path); }
/// <summary> /// <para>Copies the entire <see cref="ValidationErrorCollection"/> to a compatible one-dimensional Array, starting at the specified index of the target array.</para> /// </summary> /// <param name="array"> /// <para>The one-dimensional <see cref="ValidationError"/> array that is the destination of the elements copied from <see cref="ValidationErrorCollection"/>. The <see cref="ValidationError"/> array must have zero-based indexing.</para> /// </param> /// <param name="index"> /// <para>The zero-based index in array at which copying begins.</para> /// </param> public void CopyTo(ValidationError[] array, int index) { InnerList.CopyTo(array, index); }
/// <summary> /// <para>Determines whether the <see cref="ValidationErrorCollection"/> contains a specific element.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to locate in the <see cref="ValidationErrorCollection"/>.</para> /// </param> /// <returns> /// <para><see langword="true"/> if the CollectionBase contains the specified value; otherwise, <see langword="false"/>.</para> /// </returns> public bool Contains(ValidationError validationError) { return InnerList.Contains(validationError); }
/// <summary> /// <para>Log a <see cref="ValidationError"/> to the <see cref="IConfigurationErrorLogService"/>.</para> /// </summary> /// <param name="error"> /// <para>The <see cref="ValidationError"/> to log.</para> /// </param> protected void LogError(ValidationError error) { ServiceHelper.LogError(serviceProvider, error); }
/// <summary> /// <para>Log a <see cref="ValidationError"/> to the <see cref="IConfigurationErrorLogService"/>.</para> /// </summary> /// <param name="serviceProvider"> /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para> /// </param> /// <param name="error"> /// <para>The <see cref="ValidationError"/> to log.</para> /// </param> public static void LogError(IServiceProvider serviceProvider, ValidationError error) { ArgumentValidation.CheckForNullReference(error, "error"); IConfigurationErrorLogService configurationErrorLogService = GetConfigurationErrorService(serviceProvider); configurationErrorLogService.LogError(error); }
public void LogError(ValidationError validationError) { validationErrorCollection.Add(validationError); }
/// <summary> /// <para>Removes the first occurrence of a specific object from the <see cref="ValidationErrorCollection"/>.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to remove from the <see cref="ValidationErrorCollection"/>.</para> /// </param> public void Remove(ValidationError validationError) { InnerList.Remove(validationError); }
/// <summary> /// <para>Appends a <see cref="ValidationError"/> to the end of the collection.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to add.</para> /// </param> public void Add(ValidationError validationError) { InnerList.Add(validationError); }
/// <summary> /// <para>Removes the first occurrence of a specific object from the <see cref="ValidationErrorCollection"/>.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to remove from the <see cref="ValidationErrorCollection"/>.</para> /// </param> public void Remove(ValidationError validationError) { InnerList.Remove(validationError); }
/// <summary> /// <para>Determines whether the <see cref="ValidationErrorCollection"/> contains a specific element.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to locate in the <see cref="ValidationErrorCollection"/>.</para> /// </param> /// <returns> /// <para><see langword="true"/> if the CollectionBase contains the specified value; otherwise, <see langword="false"/>.</para> /// </returns> public bool Contains(ValidationError validationError) { return(InnerList.Contains(validationError)); }
/// <summary> /// Log a validation error. /// </summary> /// <param name="validationError">The <see cref="ValidationError"/> to log.</param> public void LogError(ValidationError validationError) { validationErrors.Add(validationError); }
private void DisplayValidationError(ValidationError validationError) { UpdateTreeNode((ConfigurationNode)validationError.InvalidItem); errorsListView.Items.Add(new ValidationErrorListViewItem(validationError)); }
private void DisplayValidationError(ValidationError error) { Console.WriteLine("DisplayValidationErrors:" + error.Message); }
/// <summary> /// <para>Searches for the specified <see cref="ValidationError"/> and returns the zero-based index of the first occurrence within the entire <see cref="ValidationErrorCollection"/>.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to locate in the <see cref="ValidationErrorCollection"/>.</para> /// </param> /// <returns> /// <para>The zero-based index of the first occurrence of value within the entire <see cref="ValidationErrorCollection"/>, if found; otherwise, -1.</para> /// </returns> public int IndexOf(ValidationError validationError) { return InnerList.IndexOf(validationError); }
/// <summary> /// <para>Inserts an element into the <see cref="ValidationErrorCollection"/> at the specified index.</para> /// </summary> /// <param name="index"> /// <para>The zero-based index at which value should be inserted.</para> /// </param> /// <param name="validationError"> /// <para>The Object to insert.</para> /// </param> public void Insert(int index, ValidationError validationError) { InnerList.Insert(index, validationError); }
/// <summary> /// <para>Inserts an element into the <see cref="ValidationErrorCollection"/> at the specified index.</para> /// </summary> /// <param name="index"> /// <para>The zero-based index at which value should be inserted.</para> /// </param> /// <param name="validationError"> /// <para>The Object to insert.</para> /// </param> public void Insert(int index, ValidationError validationError) { InnerList.Insert(index, validationError); }
/// <summary> /// <para>Appends a <see cref="ValidationError"/> to the end of the collection.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to add.</para> /// </param> public void Add(ValidationError validationError) { InnerList.Add(validationError); }
/// <summary> /// <para>Searches for the specified <see cref="ValidationError"/> and returns the zero-based index of the first occurrence within the entire <see cref="ValidationErrorCollection"/>.</para> /// </summary> /// <param name="validationError"> /// <para>The <see cref="ValidationError"/> to locate in the <see cref="ValidationErrorCollection"/>.</para> /// </param> /// <returns> /// <para>The zero-based index of the first occurrence of value within the entire <see cref="ValidationErrorCollection"/>, if found; otherwise, -1.</para> /// </returns> public int IndexOf(ValidationError validationError) { return(InnerList.IndexOf(validationError)); }