[corlib] Avoid unnecessary ephemeron array resizes
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Validation / ValidationErrorInfo.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4
5 namespace System.Activities.Presentation.Validation
6 {
7     using System;
8     using System.Collections.Generic;
9     using System.Text;
10     using System.Activities.Validation;
11     using System.Runtime;
12
13     [Serializable]
14     [Fx.Tag.XamlVisible(false)]
15     public class ValidationErrorInfo
16     {
17         public ValidationErrorInfo(string message)
18         {
19             // Used to initialize violations that correspond
20             // to exceptions triggered during validation.
21             this.Message = message;
22             this.PropertyName = string.Empty;
23             this.FileName = string.Empty;
24             this.IsWarning = false;
25         }
26
27         public ValidationErrorInfo(ValidationError validationError)
28         {
29             this.Id = validationError.Id;
30             this.Message = validationError.Message;
31             this.PropertyName = validationError.PropertyName;
32             this.FileName = string.Empty;
33             this.IsWarning = validationError.IsWarning;
34         }
35
36         public string Id { get; private set; }
37
38         public Guid SourceReferenceId { get; set; }
39
40         public string Message { get; private set; }
41
42         public string PropertyName { get; private set; }
43
44         public string FileName { get; set; }
45
46         public bool IsWarning { get; private set; }
47     }
48 }