我有一个正在创建的事件类,目前如下所示:
public class SharePointOnErrorEventsArgs : EventArgs
{
public SharePointOnErrorEventsArgs(string message, bool showException, Exception exception)
{
Message = message;
Exception = exception;
ShowException = showException;
}
/// <summary>
/// Property to allow the storage of a more verbose and explainable error message
/// </summary>
public string Message { get; private set; }
/// <summary>
/// Object to store full exception information within
/// </summary>
public Exception Exception { get; private set; }
/// <summary>
/// Boolean value allows for verbose messages to be sent up the stack without
/// the need for displaying a full exception object, or stack trace.
/// </summary>
public bool ShowException { get; private set; }
}
现在,我不想发送true
or false
forshowException
我想发送三个值之一Debug
,Info
或者Error
- 我该如何处理这样的事情?我真的不想使用字符串,因为我想始终将其限制为这三个值之一,但我不确定在使用属性时如何处理这个问题。