示例#1
0
        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject> 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))
            {
                MsgPack.MessagePackObject nullable = default(MsgPack.MessagePackObject);
                if ((unpacker.Read() == false))
                {
                    throw MsgPack.Serialization.SerializationExceptions.NewMissingItem(i);
                }
                if (((unpacker.IsArrayHeader == false) &&
                     (unpacker.IsMapHeader == false)))
                {
                    nullable = unpacker.LastReadData;
                }
                else
                {
                    nullable = unpacker.UnpackSubtreeData();
                }
                if ((nullable.IsNil == false))
                {
                    collection.Add(nullable);
                }
                else
                {
                    collection.Add(nullable);
                }
            }
        }
示例#2
0
        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.AddOnlyCollection <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 <int> nullable = default(System.Nullable <int>);
                nullable = MsgPack.Serialization.UnpackHelpers.UnpackNullableInt32Value(unpacker, typeof(MsgPack.Serialization.AddOnlyCollection <int>), string.Format(System.Globalization.CultureInfo.InvariantCulture, "item{0}", new object[] {
                    ((object)(i))
                }));
                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(int), typeof(MsgPack.Serialization.AddOnlyCollection <int>));
                }
            }
        }
 protected internal override MsgPack.Serialization.AddOnlyCollection<System.DateTime[]> UnpackFromCore(MsgPack.Unpacker unpacker) {
     if ((unpacker.IsArrayHeader == false)) {
         throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
     }
     MsgPack.Serialization.AddOnlyCollection<System.DateTime[]> collection = default(MsgPack.Serialization.AddOnlyCollection<System.DateTime[]>);
     collection = new MsgPack.Serialization.AddOnlyCollection<System.DateTime[]>();
     this.UnpackToCore(unpacker, collection);
     return collection;
 }
示例#4
0
 protected internal override MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject> UnpackFromCore(MsgPack.Unpacker unpacker)
 {
     if ((unpacker.IsArrayHeader == false))
     {
         throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
     }
     MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject> collection = default(MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject>);
     collection = new MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject>();
     this.UnpackToCore(unpacker, collection);
     return(collection);
 }
示例#5
0
        protected internal override MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]> UnpackFromCore(MsgPack.Unpacker unpacker)
        {
            if ((unpacker.IsArrayHeader == false))
            {
                throw MsgPack.Serialization.SerializationExceptions.NewIsNotArrayHeader();
            }
            int itemsCount = default(int);

            itemsCount = MsgPack.Serialization.UnpackHelpers.GetItemsCount(unpacker);
            MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]> collection = default(MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]>);
            collection = new MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]>();
            this.UnpackToCore(unpacker, collection);
            return(collection);
        }
        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.AddOnlyCollection <System.DateTime> 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.DateTime> nullable = default(System.Nullable <System.DateTime>);
                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.DateTime), typeof(MsgPack.Serialization.AddOnlyCollection <System.DateTime>));
                }
            }
        }
示例#7
0
        protected internal override void UnpackToCore(MsgPack.Unpacker unpacker, MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]> 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))
            {
                MsgPack.MessagePackObject[] nullable = default(MsgPack.MessagePackObject[]);
                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 == null)
                     == false))
                {
                    collection.Add(nullable);
                }
                else
                {
                    collection.Add(nullable);
                }
            }
        }
 protected override void AddItem(MsgPack.Serialization.AddOnlyCollection <int> collection, int item)
 {
     collection.Add(item);
 }
 protected override MsgPack.Serialization.AddOnlyCollection <int> CreateInstance(int initialCapacity)
 {
     MsgPack.Serialization.AddOnlyCollection <int> collection = default(MsgPack.Serialization.AddOnlyCollection <int>);
     collection = new MsgPack.Serialization.AddOnlyCollection <int>();
     return(collection);
 }
 protected override void AddItem(MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]> collection, MsgPack.MessagePackObject[] item)
 {
     collection.Add(item);
 }
示例#11
0
 protected internal override void PackToCore(MsgPack.Packer packer, MsgPack.Serialization.AddOnlyCollection <MsgPack.MessagePackObject[]> objectTree)
 {
     this._serializer0.PackTo(packer, System.Linq.Enumerable.ToArray(objectTree));
 }
示例#12
0
 protected override void AddItem(MsgPack.Serialization.AddOnlyCollection <System.DateTime> collection, System.DateTime item)
 {
     collection.Add(item);
 }