private static string GetErrorMessage( ThreadUnsafeErrorCode errorCode )
 {
     return errorCode == ThreadUnsafeErrorCode.InvalidThread ?
                                                                 "An attempt was made to call thread-affined method from another thread"
                : "An attempt was made to simultaneously access a single-threaded method from multiple threads.";
 }
 private static string GetErrorMessage(ThreadUnsafeErrorCode errorCode)
 {
     return(errorCode == ThreadUnsafeErrorCode.InvalidThread ?
            "An attempt was made to call thread-affined method from another thread"
                : "An attempt was made to simultaneously access a single-threaded method from multiple threads.");
 }
 public ThreadUnsafeException(ThreadUnsafeErrorCode errorCode)
     : base(GetErrorMessage( errorCode ))
 {
     this.ErrorCode = errorCode;
 }
 public ThreadUnsafeException(ThreadUnsafeErrorCode errorCode)
     : base(GetErrorMessage(errorCode))
 {
     this.ErrorCode = errorCode;
 }