//--------------------------------------------------------------------------------------------------------- /// <summary> /// Выбор шаблона привязки данных /// </summary> /// <param name="item">Объект</param> /// <param name="container">Контейнер</param> /// <returns>Нужный шаблон</returns> //--------------------------------------------------------------------------------------------------------- public override DataTemplate SelectTemplate(Object item, DependencyObject container) { TLogMessage message = (TLogMessage)item; if (String.IsNullOrEmpty(message.Module)) { if (String.IsNullOrEmpty(message.MemberName)) { return(Simple); } else { return(Trace); } } else { if (String.IsNullOrEmpty(message.MemberName)) { return(SimpleModule); } else { return(TraceModule); } } }
// Redirects the Logging Events to the console instead of an log file static void LogWriter_LogEvent (TLogMessage msg) { Console.WriteLine(msg.EVT_MESSAGE); }
//--------------------------------------------------------------------------------------------------------- /// <summary> /// Добавление сообщения /// </summary> /// <param name="message">Сообщение</param> //--------------------------------------------------------------------------------------------------------- public void Log(TLogMessage message) { mMessages.Add(message); outputData.ScrollIntoView(mMessages[mMessages.Count - 1]); }
static void LogWriter_LogEvent(TLogMessage msg) { Console.WriteLine(msg.EVT_MESSAGE); }