コード例 #1
0
 /// <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 HostaliandoExceptionCode)
     {
         return(MessageExceptionFinder.GetErrorMessage((HostaliandoExceptionCode)Enum.Parse(typeof(HostaliandoExceptionCode), exceptionCode.ToString())));
     }
     else
     {
         return(string.Empty);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HostaliandoException"/> class.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <param name="code">The code.</param>
 public HostaliandoException(string target, HostaliandoExceptionCode code) : base(MessageExceptionFinder.GetErrorMessage(code))
 {
     this.Target = target;
     this.Code   = code;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HostaliandoException"/> class.
 /// </summary>
 /// <param name="code">The code.</param>
 public HostaliandoException(HostaliandoExceptionCode code) : base(MessageExceptionFinder.GetErrorMessage(code))
 {
     this.Code = code;
 }