예제 #1
0
        public static void PersistDictionaryValue <TKey, TValue>(this StatePersister persister, Dictionary <TKey, TValue> value, PersistDictionaryItemCallback <TKey, TValue> callback)
        {
            persister.BeginObject();

            var count = (ushort)value.Count;

            persister.PersistUInt16(ref count);

            persister.PersistDictionaryImpl(value, count, callback);

            persister.EndObject();
        }
예제 #2
0
        public static void PersistDictionaryWithUInt32Count <TKey, TValue>(this StatePersister persister, Dictionary <TKey, TValue> value, PersistDictionaryItemCallback <TKey, TValue> callback, [CallerArgumentExpression("value")] string name = "")
        {
            persister.BeginObject(name);

            var count = (uint)value.Count;

            persister.PersistUInt32(ref count);

            persister.PersistDictionaryImpl(value, count, callback);

            persister.EndObject();
        }