Exemple #1
0
        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());
                }
            }
        }
Exemple #2
0
 public void WriteBoxType(BoxType inType)
 {
     this.Write(inType.GetBytes(), 0, 4);
 }
Exemple #3
0
 public void WriteBoxType(BoxType inType)
 {
     this.Write(inType.GetBytes(), 0, 4);
 }