Ejemplo n.º 1
0
		/// <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);
        }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 /// <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);
 }
Ejemplo n.º 6
0
        /// <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);
 }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 /// <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);
 }
Ejemplo n.º 11
0
 /// <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));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Log a validation error.
 /// </summary>
 /// <param name="validationError">The <see cref="ValidationError"/> to log.</param>
 public void LogError(ValidationError validationError)
 {
     validationErrors.Add(validationError);
 }
Ejemplo n.º 13
0
 private void DisplayValidationError(ValidationError validationError)
 {
     UpdateTreeNode((ConfigurationNode)validationError.InvalidItem);
     errorsListView.Items.Add(new ValidationErrorListViewItem(validationError));
 }
Ejemplo n.º 14
0
		private void DisplayValidationError(ValidationError error)
		{
			Console.WriteLine("DisplayValidationErrors:" + error.Message);
		}
Ejemplo n.º 15
0
 /// <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);
 }
Ejemplo n.º 16
0
 /// <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);
 }
Ejemplo n.º 17
0
 /// <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);
 }
Ejemplo n.º 18
0
 /// <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);
 }
Ejemplo n.º 19
0
 /// <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));
 }