Some attempts at making this compile on WinRT. Much work remains.
git-svn-id: file:///srv/devel/repo-conversion/nusu@281 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
cc1b8d095a
commit
7d4a66e9f2
8 changed files with 163 additions and 34 deletions
|
@ -34,7 +34,10 @@ namespace Nuclex.Support.Collections {
|
|||
|
||||
/// <summary>Enumerates the values stored in a multi dictionary</summary>
|
||||
private class Enumerator :
|
||||
IEnumerator<KeyValuePair<TKey, TValue>>, IDictionaryEnumerator {
|
||||
#if !WINRT
|
||||
IDictionaryEnumerator,
|
||||
#endif
|
||||
IEnumerator<KeyValuePair<TKey, TValue>> {
|
||||
|
||||
/// <summary>Initializes a new multi dictionary enumerator</summary>
|
||||
/// <param name="dictionary">Dictionary that will be enumerated</param>
|
||||
|
@ -125,6 +128,8 @@ namespace Nuclex.Support.Collections {
|
|||
|
||||
#region IDictionaryEnumerator implementation
|
||||
|
||||
#if !WINRT
|
||||
|
||||
/// <summary>The current entry the enumerator is pointing to</summary>
|
||||
DictionaryEntry IDictionaryEnumerator.Entry {
|
||||
get {
|
||||
|
@ -136,15 +141,6 @@ namespace Nuclex.Support.Collections {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Throws an exception if the enumerator is not on a valid position
|
||||
/// </summary>
|
||||
private void enforceEnumeratorOnValidPosition() {
|
||||
if(this.currentValue == null) {
|
||||
throw new InvalidOperationException("Enumerator is not on a valid position");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The current dictionary key</summary>
|
||||
object IDictionaryEnumerator.Key {
|
||||
get {
|
||||
|
@ -161,8 +157,19 @@ namespace Nuclex.Support.Collections {
|
|||
}
|
||||
}
|
||||
|
||||
#endif // !WINRT
|
||||
|
||||
#endregion // IDictionaryEnumerator implementation
|
||||
|
||||
/// <summary>
|
||||
/// Throws an exception if the enumerator is not on a valid position
|
||||
/// </summary>
|
||||
private void enforceEnumeratorOnValidPosition() {
|
||||
if(this.currentValue == null) {
|
||||
throw new InvalidOperationException("Enumerator is not on a valid position");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Dictionary over whose entries the enumerator is enumerating</summary>
|
||||
private IDictionary<TKey, ICollection<TValue>> dictionary;
|
||||
/// <summary>Current key the enumerator is at</summary>
|
||||
|
@ -220,7 +227,9 @@ namespace Nuclex.Support.Collections {
|
|||
/// <param name="dictionary">Dictionary the multi dictionary will be based on</param>
|
||||
internal MultiDictionary(IDictionary<TKey, ICollection<TValue>> dictionary) {
|
||||
this.typedDictionary = dictionary;
|
||||
#if !WINRT
|
||||
this.objectDictionary = (this.typedDictionary as IDictionary);
|
||||
#endif
|
||||
|
||||
foreach(ICollection<TValue> values in dictionary.Values) {
|
||||
this.count += values.Count;
|
||||
|
@ -402,8 +411,10 @@ namespace Nuclex.Support.Collections {
|
|||
|
||||
/// <summary>The wrapped Dictionary under its type-safe interface</summary>
|
||||
private IDictionary<TKey, ICollection<TValue>> typedDictionary;
|
||||
#if !WINRT
|
||||
/// <summary>The wrapped Dictionary under its object interface</summary>
|
||||
private IDictionary objectDictionary;
|
||||
#endif
|
||||
/// <summary>The number of items currently in the multi dictionary</summary>
|
||||
private int count;
|
||||
/// <summary>Provides the values stores in the dictionary in sequence</summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue