diff --git a/ExtensionLoader/ExtensionLoader.cs b/ExtensionLoader/ExtensionLoader.cs index ceb1b772..cd89567b 100644 --- a/ExtensionLoader/ExtensionLoader.cs +++ b/ExtensionLoader/ExtensionLoader.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Reflection; using System.CodeDom.Compiler; using System.IO; +using System.Text; namespace ExtensionLoader { @@ -95,9 +96,17 @@ namespace ExtensionLoader { CompilerResults results = CSCompiler.CompileAssemblyFromFile(CSCompilerParams, name); if (results.Errors.Count == 0) + { LoadAssemblyExtensions(results.CompiledAssembly, extensionList); + } else - throw new ExtensionException("Error(s) compiling " + name); + { + StringBuilder errors = new StringBuilder(); + errors.AppendLine("Error(s) compiling " + name); + foreach (CompilerError error in results.Errors) + errors.AppendFormat(" Line {0}: {1}{2}", error.Line, error.ErrorText, Environment.NewLine); + throw new ExtensionException(errors.ToString()); + } } if (assignableInterfaces != null) @@ -145,10 +154,7 @@ namespace ExtensionLoader } } } - catch (Exception e) - { - throw new ExtensionException("Unrecognized extension " + f, e); - } + catch (Exception) { } } return plugins; diff --git a/Programs/Simian/DoubleDictionary.cs b/Programs/Simian/DoubleDictionary.cs index dc696e6a..afc21636 100644 --- a/Programs/Simian/DoubleDictionary.cs +++ b/Programs/Simian/DoubleDictionary.cs @@ -25,8 +25,19 @@ namespace Simian { lock (syncObject) { - Dictionary1.Add(key1, value); - Dictionary2.Add(key2, value); + if (Dictionary1.ContainsKey(key1)) + { + if (!Dictionary2.ContainsKey(key2)) + throw new ArgumentException("key1 exists in the dictionary but not key2"); + } + else if (Dictionary2.ContainsKey(key2)) + { + if (!Dictionary1.ContainsKey(key1)) + throw new ArgumentException("key2 exists in the dictionary but not key1"); + } + + Dictionary1[key1] = value; + Dictionary2[key2] = value; } } @@ -81,5 +92,15 @@ namespace Simian action(value); } } + + public TValue this[TKey1 key1] + { + get { return Dictionary1[key1]; } + } + + public TValue this[TKey2 key2] + { + get { return Dictionary2[key2]; } + } } } diff --git a/Programs/Simian/Extensions/ImageDelivery.cs b/Programs/Simian/Extensions/ImageDelivery.cs index 65dc7a81..d2910251 100644 --- a/Programs/Simian/Extensions/ImageDelivery.cs +++ b/Programs/Simian/Extensions/ImageDelivery.cs @@ -85,7 +85,6 @@ namespace Simian.Extensions { Simian server; Dictionary CurrentDownloads = new Dictionary(); - BlockingQueue CurrentDownloadQueue = new BlockingQueue(); public ImageDelivery() {