Added XNA 4.0 XBox 360 project; fixed compilation errors that would result from compiling Nuclex.Support on the XBox 360's special compact framework

git-svn-id: file:///srv/devel/repo-conversion/nusu@202 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2010-09-17 01:43:00 +00:00
parent 5f5b8b519b
commit 1aad371ece
17 changed files with 533 additions and 26 deletions

View file

@ -98,7 +98,7 @@ namespace Nuclex.Support.Plugins {
}
}
catch(Exception exception) {
Trace.WriteLine("Could not employ " + type.ToString() + ": " + exception.Message);
reportError("Could not employ " + type.ToString() + ": " + exception.Message);
}
}
@ -118,6 +118,14 @@ namespace Nuclex.Support.Plugins {
return false;
}
/// <summary>Reports an error to the debugging console</summary>
/// <param name="error">Error message that will be reported</param>
private static void reportError(string error) {
#if !XBOX360
Trace.WriteLine(error);
#endif
}
/// <summary>Employs and manages types in the loaded plugin assemblies</summary>
private Employer employer;
/// <summary>Repository containing all plugins loaded, shared with other hosts</summary>

View file

@ -78,7 +78,7 @@ namespace Nuclex.Support.Plugins {
// Unauthorized acccess - Either the assembly is not trusted because it contains
// code that imposes a security risk on the system or a user rights problem
catch(UnauthorizedAccessException) {
Trace.WriteLine(
reportError(
"Not authorized to load assembly '" + path + "', " +
"possible rights problem"
);
@ -86,14 +86,14 @@ namespace Nuclex.Support.Plugins {
// Bad image format - This exception is often thrown when the assembly we
// attempted to load requires a different version of the .NET framework
catch(BadImageFormatException) {
Trace.WriteLine(
reportError(
"'" + path + "' is not a .NET assembly, requires a different version " +
"of the .NET Runtime or does not support the current instruction set (x86/x64)"
);
}
// Unknown error - Our last resort is to show a default error message
catch(Exception exception) {
Trace.WriteLine(
reportError(
"Failed to load plugin assembly '" + path + "': " + exception.Message
);
}
@ -175,6 +175,14 @@ namespace Nuclex.Support.Plugins {
get { return this.assemblies; }
}
/// <summary>Reports an error to the debugging console</summary>
/// <param name="error">Error message that will be reported</param>
private static void reportError(string error) {
#if !XBOX360
Trace.WriteLine(error);
#endif
}
/// <summary>Loaded plugin assemblies</summary>
private List<Assembly> assemblies;
/// <summary>Takes care of loading assemblies for the repositories</summary>

View file

@ -4,6 +4,8 @@ using System.Text;
namespace Nuclex.Support.Plugins {
#if !NO_CLONING
/// <summary>Factory that creates instances by cloning a prototype</summary>
/// <typeparam name="ProductType">Type of product created by the factory</typeparam>
/// <typeparam name="ConcreteType">Type of the prototype that will be cloned</typeparam>
@ -51,4 +53,6 @@ namespace Nuclex.Support.Plugins {
}
#endif // !NO_CLONING
} // namespace Nuclex.Support.Plugins