Added prototype code for an inversion-of-control container and a progress tracking service; moved XmlHelper class from Nuclex.UserInterface to Nuclex.Support; Nuclex.Support now uses the .NET Framework's own AssemblyLoadEventArgs class if it is compiled for the full framework; fixed a bug in the Request class that would cause exceptions to not be reported if Join() was called on a Request<x> was casted to a plain Request

git-svn-id: file:///srv/devel/repo-conversion/nusu@138 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2009-05-20 20:14:21 +00:00
parent d0fe47239e
commit 41dcfa34d0
15 changed files with 1030 additions and 6 deletions

View file

@ -28,6 +28,8 @@ using NUnit.Framework;
namespace Nuclex.Support.Plugins {
#if XBOX360
/// <summary>Unit Test for the assembly load event argument container</summary>
[TestFixture]
public class AssemblyLoadEventArgsTest {
@ -46,6 +48,8 @@ namespace Nuclex.Support.Plugins {
}
#endif // XBOX360
} // namespace Nuclex.Support.Plugins
#endif // UNITTEST

View file

@ -24,6 +24,8 @@ using System.Reflection;
namespace Nuclex.Support.Plugins {
#if XBOX360
/// <summary>Signature for the AssemblyLoad event</summary>
/// <param name="sender">Object that is reporting that an assembly was loaded</param>
/// <param name="arguments">Contains the loaded assembly</param>
@ -50,4 +52,6 @@ namespace Nuclex.Support.Plugins {
}
#endif // XBOX360
} // namespace Nuclex.Support.Plugins

View file

@ -37,8 +37,8 @@ namespace Nuclex.Support.Plugins {
/// <summary>Initializes a plugin host using a new repository</summary>
/// <param name="employer">Employer used assess and employ the plugin types</param>
public PluginHost(Employer employer)
: this(employer, new PluginRepository()) { }
public PluginHost(Employer employer) :
this(employer, new PluginRepository()) { }
/// <summary>Initializes the plugin using an existing repository</summary>
/// <param name="employer">Employer used assess and employ the plugin types</param>
@ -47,8 +47,9 @@ namespace Nuclex.Support.Plugins {
this.employer = employer;
this.repository = repository;
foreach(Assembly assembly in this.repository.LoadedAssemblies)
foreach(Assembly assembly in this.repository.LoadedAssemblies) {
employAssemblyTypes(assembly);
}
this.repository.AssemblyLoaded += new AssemblyLoadEventHandler(assemblyLoadHandler);
}
@ -75,7 +76,9 @@ namespace Nuclex.Support.Plugins {
private void employAssemblyTypes(Assembly assembly) {
// Iterate all types contained in the assembly
foreach(Type type in assembly.GetTypes()) {
Type[] types = assembly.GetTypes();
for(int index = 0; index < types.Length; ++index) {
Type type = types[index];
// We'll ignore abstract and non-public types
if(!type.IsPublic || type.IsAbstract) {
@ -97,7 +100,6 @@ namespace Nuclex.Support.Plugins {
catch(Exception exception) {
Trace.WriteLine("Could not employ " + type.ToString() + ": " + exception.Message);
}
}
}