コード例 #1
0
        /// <summary>
        /// Gets the error message.
        /// </summary>
        /// <param name="errorCode">The error code.</param>
        /// <returns>
        /// The error message text.
        /// </returns>
        private static string GetErrorMessage(EventErrorCode errorCode)
        {
            string message = errorCodeToMessage.ContainsKey(errorCode)
                ? errorCodeToMessage[errorCode] : Unexpected;

            return(message);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventException"/> class.
 /// </summary>
 /// <param name="errorCode">The error code.</param>
 public EventException(EventErrorCode errorCode)
     : base(GetErrorMessage(errorCode))
 {
     this.ErrorCode = errorCode;
 }