예제 #1
0
            //---------------------------------------------------------------------------------------------------------
            /// <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);
                    }
                }
            }
예제 #2
0
 // Redirects the Logging Events to the console instead of an log file
 static void LogWriter_LogEvent (TLogMessage msg)
 {
     Console.WriteLine(msg.EVT_MESSAGE);
 }
예제 #3
0
 //---------------------------------------------------------------------------------------------------------
 /// <summary>
 /// Добавление сообщения
 /// </summary>
 /// <param name="message">Сообщение</param>
 //---------------------------------------------------------------------------------------------------------
 public void Log(TLogMessage message)
 {
     mMessages.Add(message);
     outputData.ScrollIntoView(mMessages[mMessages.Count - 1]);
 }
예제 #4
0
 static void LogWriter_LogEvent(TLogMessage msg)
 {
     Console.WriteLine(msg.EVT_MESSAGE);
 }