Made Nuclex.Support compileable on the XBox 360; added new XNA 3.0 project to compile Nuclex.Support on the XBox 360; added my own AssemblyLoadEventArgs implementation since the XBox 360 XNA framework doesn't provide it; other minor fixes so Nuclex.Support can cope with the XBox 360 XNA framework

git-svn-id: file:///srv/devel/repo-conversion/nusu@113 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2009-01-13 18:50:52 +00:00
parent 8f6616f79a
commit 0a483b4d44
19 changed files with 473 additions and 28 deletions

View file

@ -18,14 +18,14 @@ License along with this library
*/
#endregion
#if UNITTEST
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
#if UNITTEST
using NUnit.Framework;
namespace Nuclex.Support.Collections {

View file

@ -31,10 +31,14 @@ namespace Nuclex.Support.Collections {
/// <typeparam name="ValueType">Type of the values used in the Dictionary</typeparam>
[Serializable]
public class ReadOnlyDictionary<KeyType, ValueType> :
IDictionary<KeyType, ValueType>,
IDictionary,
#if !COMPACTFRAMEWORK
ISerializable,
IDeserializationCallback {
IDeserializationCallback,
#endif
IDictionary<KeyType, ValueType>,
IDictionary {
#if !COMPACTFRAMEWORK
#region class SerializedDictionary
@ -65,13 +69,6 @@ namespace Nuclex.Support.Collections {
#endregion // class SerializeDictionary
/// <summary>Initializes a new read-only Dictionary wrapper</summary>
/// <param name="dictionary">Dictionary that will be wrapped</param>
public ReadOnlyDictionary(IDictionary<KeyType, ValueType> dictionary) {
this.typedDictionary = dictionary;
this.objectDictionary = (this.typedDictionary as IDictionary);
}
/// <summary>
/// Initializes a new instance of the System.WeakReference class, using deserialized
/// data from the specified serialization and stream objects.
@ -90,6 +87,16 @@ namespace Nuclex.Support.Collections {
protected ReadOnlyDictionary(SerializationInfo info, StreamingContext context) :
this(new SerializedDictionary(info, context)) { }
#endif // !COMPACTFRAMEWORK
/// <summary>Initializes a new read-only Dictionary wrapper</summary>
/// <param name="dictionary">Dictionary that will be wrapped</param>
public ReadOnlyDictionary(IDictionary<KeyType, ValueType> dictionary) {
this.typedDictionary = dictionary;
this.objectDictionary = (this.typedDictionary as IDictionary);
}
/// <summary>Whether the directory is write-protected</summary>
public bool IsReadOnly {
get { return true; }
@ -360,6 +367,7 @@ namespace Nuclex.Support.Collections {
#endregion
#if !COMPACTFRAMEWORK
#region ISerializable implementation
/// <summary>Serializes the Dictionary</summary>
@ -380,6 +388,7 @@ namespace Nuclex.Support.Collections {
}
#endregion
#endif //!COMPACTFRAMEWORK
/// <summary>The wrapped Dictionary under its type-safe interface</summary>
private IDictionary<KeyType, ValueType> typedDictionary;