You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/12/19 20:22:20 UTC
cvs commit: logging-log4net/src/Appender EventLogAppender.cs
nicko 2004/12/19 11:22:20
Modified: src/Appender EventLogAppender.cs
Log:
Updates suggested by FxCop.
Minor naming changes to internal types.
Perf improvements to type check + type cast code.
Revision Changes Path
1.13 +12 -8 logging-log4net/src/Appender/EventLogAppender.cs
Index: EventLogAppender.cs
===================================================================
RCS file: /home/cvs/logging-log4net/src/Appender/EventLogAppender.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- EventLogAppender.cs 22 Nov 2004 02:09:06 -0000 1.12
+++ EventLogAppender.cs 19 Dec 2004 19:22:20 -0000 1.13
@@ -328,16 +328,20 @@
{
eventID = (int)eventIDPropertyObj;
}
- else if (eventIDPropertyObj is string)
+ else
{
- // Read the string property into a number
- try
+ string eventIDPropertyString = eventIDPropertyObj as string;
+ if (eventIDPropertyString != null)
{
- eventID = int.Parse((string)eventIDPropertyObj, CultureInfo.InvariantCulture);
- }
- catch(Exception ex)
- {
- ErrorHandler.Error("Unable to parse event ID property [" + eventIDPropertyObj + "].", ex);
+ // Read the string property into a number
+ try
+ {
+ eventID = int.Parse(eventIDPropertyString, CultureInfo.InvariantCulture);
+ }
+ catch(Exception ex)
+ {
+ ErrorHandler.Error("Unable to parse event ID property [" + eventIDPropertyString + "].", ex);
+ }
}
}
}