Пример #1
0
            public void Write(Stream s)
            {
                Key.Write(s);

                switch (Key.Type)
                {
                case enumVariousElement.Bool:
                    BinaryAccess.Write(s, (bool)Value);
                    break;

                case enumVariousElement.Byte:
                    BinaryAccess.Write(s, (byte)Value);
                    break;

                case enumVariousElement.Short:
                    BinaryAccess.Write(s, (short)Value);
                    break;

                case enumVariousElement.UShort:
                    BinaryAccess.Write(s, (ushort)Value);
                    break;

                case enumVariousElement.Int:
                    BinaryAccess.Write(s, (int)Value);
                    break;

                case enumVariousElement.UInt:
                    BinaryAccess.Write(s, (uint)Value);
                    break;

                case enumVariousElement.Long:
                    BinaryAccess.Write(s, (long)Value);
                    break;

                case enumVariousElement.ULong:
                    BinaryAccess.Write(s, (ulong)Value);
                    break;

                case enumVariousElement.Float:
                    BinaryAccess.Write(s, (float)Value);
                    break;

                case enumVariousElement.Double:
                    BinaryAccess.Write(s, (double)Value);
                    break;

                case enumVariousElement.String:
                    BinaryAccess.Write(s, (string)Value);
                    break;

                case enumVariousElement.Bytes:
                    BinaryAccess.Write(s, (byte[])Value);
                    break;

                case enumVariousElement.Table:
                    ((VariousTable)Value).Write(s);
                    break;
                }
            }
Пример #2
0
        public void Write(Stream s)
        {
            BinaryAccess.Write(s, (int)TableList.Count);

            foreach (Element e in TableList.Values)
            {
                e.Write(s);
            }
        }
Пример #3
0
        public void Read(Stream s)
        {
            int     count;
            Element e;

            this.Clear();

            count = BinaryAccess.ReadInt(s);

            for (int i = 0; i < count; i++)
            {
                e = new Element();
                e.Read(s);

                TableList.Add(e.Key, e);
            }
        }
Пример #4
0
 public void Write(Stream s)
 {
     BinaryAccess.Write(s, Name);
     BinaryAccess.Write(s, (int)Type);
 }
Пример #5
0
 public void Read(Stream s)
 {
     Name = BinaryAccess.ReadString(s);
     Type = (enumVariousElement)BinaryAccess.ReadInt(s);
 }
Пример #6
0
            public void Read(Stream s)
            {
                Key = new Key();
                Key.Read(s);

                switch (Key.Type)
                {
                case enumVariousElement.Bool:
                    Value = BinaryAccess.ReadBool(s);
                    break;

                case enumVariousElement.Byte:
                    Value = BinaryAccess.ReadByte(s);
                    break;

                case enumVariousElement.Short:
                    Value = BinaryAccess.ReadShort(s);
                    break;

                case enumVariousElement.UShort:
                    Value = BinaryAccess.ReadUShort(s);
                    break;

                case enumVariousElement.Int:
                    Value = BinaryAccess.ReadInt(s);
                    break;

                case enumVariousElement.UInt:
                    Value = BinaryAccess.ReadUInt(s);
                    break;

                case enumVariousElement.Long:
                    Value = BinaryAccess.ReadLong(s);
                    break;

                case enumVariousElement.ULong:
                    Value = BinaryAccess.ReadULong(s);
                    break;

                case enumVariousElement.Float:
                    Value = BinaryAccess.ReadFloat(s);
                    break;

                case enumVariousElement.Double:
                    Value = BinaryAccess.ReadDouble(s);
                    break;

                case enumVariousElement.String:
                    Value = BinaryAccess.ReadString(s);
                    break;

                case enumVariousElement.Bytes:
                    Value = BinaryAccess.ReadBytes(s);
                    break;

                case enumVariousElement.Table:
                    Value = new VariousTable();
                    ((VariousTable)Value).Read(s);
                    break;
                }
            }