private object ReadArray(DataBuffer buffer, object inst) { var count = buffer.ReadInt16(); Array arr = (Array)Activator.CreateInstance(ListType.MakeArrayType(), new object[] { (int)count }); for (int i = 0; i < count; i++) { arr.SetValue(Parent.Read(buffer, ListType), i); } return(arr); }
private object ReadList(DataBuffer buffer, object inst) { IList ret = (IList)Activator.CreateInstance(typeof(List <>).MakeGenericType(ListType)); var count = buffer.ReadInt16(); for (int i = 0; i < count; i++) { ret.Add(Parent.Read(buffer, ListType)); } return(ret); }
public void ReadFrom(DataBuffer buffer) { UserId = buffer.ReadInt16(); }