public void WriteProperties(object variable) { foreach (PropertyInfo info in variable.GetType().GetProperties(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) { if (info.PropertyType == typeof(ulong)) { this.WriteUInt64((UInt64)info.GetValue(variable, null)); // info.SetValue(variable, this.ReadUInt64(), null); } else if (info.PropertyType == typeof(uint)) { this.WriteUInt32((UInt32)info.GetValue(variable, null)); // info.SetValue(variable, this.ReadUInt32(), null); } else if (info.PropertyType == typeof(ushort)) { this.WriteUInt16((UInt16)info.GetValue(variable, null)); // info.SetValue(variable, this.ReadUInt16(), null); } else if (info.PropertyType == typeof(byte)) { this.Write((byte)info.GetValue(variable, null)); // info.SetValue(variable, this.ReadByte(), null); } else { BoxType btype = (BoxType)info.GetValue(variable, null); this.Write(btype.GetBytes()); } } }
public void WriteBoxType(BoxType inType) { this.Write(inType.GetBytes(), 0, 4); }
public void WriteBoxType(BoxType inType) { this.Write(inType.GetBytes(), 0, 4); }