public object Read(ProtoReader reader) { IList list = (isArray ? new ArrayList() : (IList)Activator.CreateInstance(listType)); int fieldNumber; int messageSize = reader.BeginSubMessage(); while ((fieldNumber = reader.ReadTag()) > 0) { object value; if (reader.WireType == WireType.Null) { value = reader.ReadNull(); } else { value = this.typeDescription.NestedMessageSerializer.Read(reader); } list.Add(value); } reader.EndSubMessage(messageSize); if (isArray) { int length = list.Count; Array array = Array.CreateInstance(elementType, length); list.CopyTo(array, 0); return array; } return list; }
public object Read(ProtoReader reader) { if (reader.WireType == WireType.Null) { return reader.ReadNull(); } return typeDescription.NestedMessageSerializer.Read(reader); }
public object Read(ProtoReader reader) { if (reader.WireType == WireType.Null) { return reader.ReadNull(); } else { return reader.ReadString(); } }
public object Read(ProtoReader reader) { if (reader.WireType == WireType.Null) { return reader.ReadNull(); } object value = null; int messageSize = reader.BeginSubMessage(); value = this.itemSerializer.Read(reader); reader.EndSubMessage(messageSize); return value; }
public void Read(ProtoReader reader, object instance) { object value; if (reader.WireType == WireType.Null) { value = reader.ReadNull(); } else { value = typeDescription.NestedMessageSerializer.Read(reader); } propertyInfo.SetValue(instance, value, null); }