本文整理汇总了C#中Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LogEntry.ToString方法的具体用法?C# LogEntry.ToString怎么用?C# LogEntry.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry
的用法示例。
在下文中一共展示了LogEntry.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: logEventInformationButton_Click
private void logEventInformationButton_Click(object sender, EventArgs e)
{
EventInformationForm eventForm = new EventInformationForm();
DialogResult result = eventForm.ShowDialog();
if (result == DialogResult.OK)
{
try
{
Cursor.Current = Cursors.WaitCursor;
// Creates and fills the log entry with user information
LogEntry logEntry = new LogEntry();
logEntry.EventId = eventForm.EventId;
logEntry.Priority = eventForm.Priority;
logEntry.Message = eventForm.Message;
logEntry.Categories.Clear();
// Add the categories selected by the user
foreach (string category in eventForm.Categories)
{
logEntry.Categories.Add(category);
}
DisplayScenarioStart(String.Format(Properties.Resources.LogEventStartMessage, logEntry.ToString()));
// Writes the log entry.
Logger.Write(logEntry);
this.DisplayResults(String.Format(Properties.Resources.EventProcessedMessage, logEntry.EventId));
}
catch (Exception ex)
{
ProcessUnhandledException(ex);
}
finally
{
Cursor.Current = Cursors.Default;
}
}
}