nicko       2004/12/19 11:23:36

  Modified:    src/Layout/Pattern PatternLayoutConverter.cs
  Log:
  Updates suggested by FxCop.
  Minor naming changes to internal types.
  Perf improvements to type check + type cast code.
  
  Revision  Changes    Path
  1.4       +4 -3      
logging-log4net/src/Layout/Pattern/PatternLayoutConverter.cs
  
  Index: PatternLayoutConverter.cs
  ===================================================================
  RCS file: 
/home/cvs/logging-log4net/src/Layout/Pattern/PatternLayoutConverter.cs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PatternLayoutConverter.cs 19 Sep 2004 19:50:45 -0000      1.3
  +++ PatternLayoutConverter.cs 19 Dec 2004 19:23:36 -0000      1.4
  @@ -98,13 +98,14 @@
                /// <param name="state">The state object on which the pattern 
converter should be executed.</param>
                override protected void Convert(TextWriter writer, object state)
                {
  -                     if (state is LoggingEvent)
  +                     LoggingEvent loggingEvent = state as LoggingEvent;
  +                     if (loggingEvent != null)
                        {
  -                             Convert(writer, (LoggingEvent)state);
  +                             Convert(writer, loggingEvent);
                        }
                        else
                        {
  -                             throw new ArgumentException("state must be a 
LoggingEvent", "state");
  +                             throw new ArgumentException("state must be of 
type ["+typeof(LoggingEvent).FullName+"]", "state");
                        }
                }
   
  
  
  

Reply via email to