Index: Util/PatternConverter.cs
===================================================================
--- Util/PatternConverter.cs (revision 330384)
+++ Util/PatternConverter.cs (working copy)
@@ -16,12 +16,10 @@
//
#endregion
-using System;
using System.Text;
using System.IO;
using System.Collections;
-using log4net.Core;
using log4net.Util;
using log4net.Repository;
@@ -292,12 +290,36 @@
///
protected static void WriteDictionary(TextWriter writer, ILoggerRepository repository, IDictionary value)
{
+ WriteDictionary(writer, repository, value.GetEnumerator());
+ }
+
+ ///
+ /// Write an dictionary to a
+ ///
+ /// the writer to write to
+ /// a to use for object conversion
+ /// the value to write to the writer
+ ///
+ ///
+ /// Writes the to a writer in the form:
+ ///
+ ///
+ /// {key1=value1, key2=value2, key3=value3}
+ ///
+ ///
+ /// If the specified
+ /// is not null then it is used to render the key and value to text, otherwise
+ /// the object's ToString method is called.
+ ///
+ ///
+ protected static void WriteDictionary(TextWriter writer, ILoggerRepository repository, IDictionaryEnumerator value)
+ {
writer.Write("{");
bool first = true;
// Write out all the dictionary key value pairs
- foreach(DictionaryEntry entry in value)
+ while (value.MoveNext())
{
if (first)
{
@@ -307,9 +329,9 @@
{
writer.Write(", ");
}
- WriteObject(writer, repository, entry.Key);
+ WriteObject(writer, repository, value.Key);
writer.Write("=");
- WriteObject(writer, repository, entry.Value);
+ WriteObject(writer, repository, value.Value);
}
writer.Write("}");