| | 1 | | using System.Globalization; |
| | 2 | | using System.Resources; |
| | 3 | | using ValidateLib.ResultCreators; |
| | 4 | |
|
| | 5 | | namespace ValidateLib.ErrorsAndWarnings |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// Represents object that carries error or warning message. |
| | 9 | | /// </summary> |
| | 10 | | public abstract class ErrorOrWarning : Exception, IMessageHolder |
| | 11 | | { |
| 0 | 12 | | ResourceManager _ResourceManager { get; set; } = |
| 1 | 13 | | new ResourceManager(EWConstants.GeneralResources, typeof(ErrorOrWarning).Assembly); |
| | 14 | |
|
| 1 | 15 | | protected ResourceManager GeneralManager = new ResourceManager(EWConstants.ErrorResources, typeof(ErrorOrWarning |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Returns localized error or warning message. |
| | 19 | | /// </summary> |
| | 20 | | /// <param name="cultureInfo"> Culture in which the error message text should be localized.</param> |
| | 21 | | /// <returns> Localized error/warning message.</returns> |
| 0 | 22 | | public virtual string GetMessage(CultureInfo cultureInfo) => _ResourceManager.GetString("GeneralMessage", cultur |
| | 23 | | /// <summary> |
| | 24 | | /// Specifies what type of error it is. Inherited classes override this property. |
| | 25 | | /// </summary> |
| | 26 | | /// <returns> <see cref="ErrorType"/>></returns> |
| 0 | 27 | | public virtual ErrorType GetErrorType() => ErrorType.VALID; |
| | 28 | | } |
| | 29 | | } |