internal static void ToNativeInternal(IntPtr nativeBuffer, int arrayIndex, IDictionary <TKey, TValue> value, ref FScriptMapHelper helper, MarshalingDelegates <TKey> .ToNative keyToNative, MarshalingDelegates <TValue> .ToNative valueToNative) { IntPtr scriptMapAddress = nativeBuffer + (arrayIndex * Marshal.SizeOf(typeof(FScriptMap))); helper.Map = scriptMapAddress; // Make sure any existing elements are properly destroyed helper.EmptyValues(); if (value == null) { return; } unsafe { FScriptMap *map = (FScriptMap *)scriptMapAddress; Dictionary <TKey, TValue> dictionary = value as Dictionary <TKey, TValue>; if (dictionary != null) { foreach (KeyValuePair <TKey, TValue> pair in dictionary) { helper.AddPair(pair.Key, pair.Value, keyToNative, valueToNative); } return; } TMapBase <TKey, TValue> mapBase = value as TMapBase <TKey, TValue>; if (mapBase != null) { foreach (KeyValuePair <TKey, TValue> pair in mapBase) { helper.AddPair(pair.Key, pair.Value, keyToNative, valueToNative); } return; } foreach (KeyValuePair <TKey, TValue> pair in value) { helper.AddPair(pair.Key, pair.Value, keyToNative, valueToNative); } } }
public ValueCollection(TMapBase <TKey, TValue> map) { this.map = map; }
public Enumerator(TMapBase <TKey, TValue> map) { this.map = map; index = -1; }
public KeyEnumerator(TMapBase <TKey, TValue> map) { this.map = map; }