/// <summary>
 /// Gets the error message depending of the exception code
 /// </summary>
 /// <typeparam name="T">the type of errors</typeparam>
 /// <param name="exceptionCode">The exception code.</param>
 /// <returns>
 /// The text of exception
 /// </returns>
 public string GetErrorMessage <T>(T exceptionCode)
 {
     if (exceptionCode is SpellingExceptionCode)
     {
         return(MessageExceptionFinder.GetErrorMessage((SpellingExceptionCode)Enum.Parse(typeof(SpellingExceptionCode), exceptionCode.ToString())));
     }
     else
     {
         return(string.Empty);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpellingException"/> class.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="code">The code.</param>
 public SpellingException(string target, SpellingExceptionCode code) : base(MessageExceptionFinder.GetErrorMessage(code))
 {
     this.Target = target;
     this.Code   = code;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpellingException"/> class.
 /// </summary>
 /// <param name="code">The code.</param>
 public SpellingException(SpellingExceptionCode code) : base(MessageExceptionFinder.GetErrorMessage(code))
 {
     this.Code = code;
 }