# HG changeset patch # User IBBoard # Date 1231094732 0 # Node ID 465b672e9682211cfb7da8f8188692ef94de5033 # Parent ba9239164de2d26bd5bd5d52cc605ce8fca7a144 Closes #5 - Dictionary to array converter * Handled null dictionary * Fixed casting problems * Added documentation Also remove rogue Console.Write in LogNotifier diff -r ba9239164de2 -r 465b672e9682 Collections/DictionaryToArrayConverter.cs --- a/Collections/DictionaryToArrayConverter.cs Sun Jan 04 14:44:19 2009 +0000 +++ b/Collections/DictionaryToArrayConverter.cs Sun Jan 04 18:45:32 2009 +0000 @@ -25,11 +25,25 @@ public class DictionaryToArrayConverter { + /// + /// Takes the set of values in a dictionary and returns them as an array of typed objects. + /// + /// + /// A to extract an array of values from + /// + /// + /// An array of objects taken from the Values property of the dictionary, or NULL if the dictionary is NULL + /// public static VALUE_TYPE[] Convert(Dictionary dictionary) { - VALUE_TYPE[] col = (VALUE_TYPE[]) new object[dictionary.Count]; + if (dictionary == null) + { + return null; + } + + VALUE_TYPE[] col = new VALUE_TYPE[dictionary.Count]; dictionary.Values.CopyTo(col, 0); - return (VALUE_TYPE[])col; + return col; } } } diff -r ba9239164de2 -r 465b672e9682 Logging/LogNotifier.cs --- a/Logging/LogNotifier.cs Sun Jan 04 14:44:19 2009 +0000 +++ b/Logging/LogNotifier.cs Sun Jan 04 18:45:32 2009 +0000 @@ -62,7 +62,6 @@ public static void Info(Type logFromType, Object message, Exception e) { - Console.WriteLine("Info: "+(InfoLogEventOccurred!=null ? "true":"false")+" "+message); if (InfoLogEventOccurred!=null) { InfoLogEventOccurred(logFromType, message, e);