protected internal override MsgPack.Serialization.DictionaryValueType <int, int> UnpackFromCore(MsgPack.Unpacker unpacker) { if ((unpacker.IsArrayHeader == false)) { throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader(); } MsgPack.Serialization.DictionaryValueType <int, int> collection = default(MsgPack.Serialization.DictionaryValueType <int, int>); collection = new MsgPack.Serialization.DictionaryValueType <int, int>(MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker)); this.UnpackToCore(unpacker, collection); return(collection); }
protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.DictionaryValueType <int, int> collection) { if ((unpacker.IsArrayHeader == false)) { throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader(); } int count = default(int); count = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker); for (int i = 0; (i < count); i = (i + 1)) { System.Nullable <System.Collections.Generic.KeyValuePair <int, int> > nullable = default(System.Nullable <System.Collections.Generic.KeyValuePair <int, int> >); if ((unpacker.Read() == false)) { throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i); } if (((unpacker.IsArrayHeader == false) && (unpacker.IsMapHeader == false))) { nullable = this._serializer1.UnpackFrom(unpacker); } else { MsgPack.Unpacker disposable = default(MsgPack.Unpacker); disposable = unpacker.ReadSubtree(); try { nullable = this._serializer1.UnpackFrom(disposable); } finally { if (((disposable == null) == false)) { disposable.Dispose(); } } } if (nullable.HasValue) { collection.Add(nullable.Value); } else { throw MsgPack.Serialization.SerializationExceptions.NewValueTypeCannotBeNull(string.Format(System.Globalization.CultureInfo.InvariantCulture, "item{0}", new object[] { ((object)(i)) }), typeof(System.Collections.Generic.KeyValuePair <int, int>), typeof(MsgPack.Serialization.DictionaryValueType <int, int>)); } } }
protected internal override void PackToCore(MsgPack.Packer packer, MsgPack.Serialization.DictionaryValueType <int, int> objectTree) { packer.PackArrayHeader(objectTree.Count); System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <int, int> > enumerator = objectTree.GetEnumerator(); System.Collections.Generic.KeyValuePair <int, int> current; try { for ( ; enumerator.MoveNext(); ) { current = enumerator.Current; this._serializer0.PackTo(packer, current); } } finally { enumerator.Dispose(); } }
protected override MsgPack.Serialization.DictionaryValueType <int, int> CreateInstance(int initialCapacity) { MsgPack.Serialization.DictionaryValueType <int, int> collection = default(MsgPack.Serialization.DictionaryValueType <int, int>); collection = new MsgPack.Serialization.DictionaryValueType <int, int>(initialCapacity); return(collection); }