11using System ;
2+ using System . Collections . Generic ;
23using System . Text ;
34using System . Windows . Forms ;
45using NLog . Common ;
@@ -65,7 +66,7 @@ protected override void Write(LogEventInfo logEvent)
6566 {
6667 try
6768 {
68- MessageBox . Show ( this . Layout . Render ( logEvent ) , this . Caption . Render ( logEvent ) ) ;
69+ MessageBox . Show ( RenderLogEvent ( this . Layout , logEvent ) , RenderLogEvent ( this . Caption , logEvent ) ) ;
6970 }
7071 catch ( Exception ex )
7172 {
@@ -85,26 +86,25 @@ protected override void Write(LogEventInfo logEvent)
8586 /// </summary>
8687 /// <param name="logEvents">The array of logging events.</param>
8788 [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Globalization" , "CA1300:SpecifyMessageBoxOptions" ,
88- Justification = "This is just debugging output." ) ]
89- [ Obsolete ( "Instead override Write(IList<AsyncLogEventInfo> logEvents. Marked obsolete on NLog 4.5" ) ]
90- protected override void Write ( AsyncLogEventInfo [ ] logEvents )
89+ Justification = "This is just debugging output." ) ]
90+ protected override void Write ( IList < AsyncLogEventInfo > logEvents )
9191 {
92- if ( logEvents . Length == 0 )
92+ if ( logEvents . Count == 0 )
9393 {
9494 return ;
9595 }
9696
9797 var sb = new StringBuilder ( ) ;
98- var lastLogEvent = logEvents [ logEvents . Length - 1 ] ;
98+ var lastLogEvent = logEvents [ logEvents . Count - 1 ] ;
9999 foreach ( var ev in logEvents )
100100 {
101- sb . Append ( this . Layout . Render ( ev . LogEvent ) ) ;
101+ sb . Append ( RenderLogEvent ( this . Layout , ev . LogEvent ) ) ;
102102 sb . Append ( "\n " ) ;
103103 }
104104
105- MessageBox . Show ( sb . ToString ( ) , this . Caption . Render ( lastLogEvent . LogEvent ) ) ;
105+ MessageBox . Show ( sb . ToString ( ) , RenderLogEvent ( this . Caption , lastLogEvent . LogEvent ) ) ;
106106
107- for ( int i = 0 ; i < logEvents . Length ; ++ i )
107+ for ( int i = 0 ; i < logEvents . Count ; ++ i )
108108 {
109109 logEvents [ i ] . Continuation ( null ) ;
110110 }
0 commit comments