public void UnpackFromMessage( Unpacker unpacker ) { if ( !unpacker.IsArrayHeader || unpacker.LastReadData.AsInt32() != 5 ) { throw new ArgumentException( "Must be 5 element array." ); } var asList = unpacker.UnpackSubtree().Value.AsList(); uri = asList[ 0 ].AsString(); title = asList[ 1 ].AsString(); width = asList[ 2 ].AsInt32(); height = asList[ 3 ].AsInt32(); size = asList[ 4 ].AsInt32(); }
public void UnpackFromMessage(Unpacker unpacker) { if (!unpacker.IsArrayHeader || unpacker.Data.Value.AsInt32() != 5) { throw new ArgumentException("Must be 5 element array."); } var asList = unpacker.UnpackSubtree().Value.AsList(); uri = asList[0].AsString(); title = asList[1].AsString(); width = asList[2].AsInt32(); height = asList[3].AsInt32(); size = asList[4].AsInt32(); }