Esempio n. 1
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                if (MapGuid == null)
                {
                    MapGuid = new byte[0x10];
                }
                io.Write(MapGuid, 0, 0X10);
                if (Pins == null)
                {
                    Pins = new DynamicMapPinInfo[PinsCount];

                    for (int xb = 0; xb < PinsCount; xb++)
                    {
                        Pins[xb] = new DynamicMapPinInfo();
                    }
                }
                io.WriteInt16((short)Pins.Length);
                foreach (DynamicMapPinInfo t in Pins)
                {
                    t.Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 2
0
 public DynamicPinsMap Read(DAIIO io)
 {
     xLength = io.ReadBit2(LengthBits);
     MapGuid = new byte[0x10];
     io.Read(MapGuid, 0, 0x10);
     PinsCount = io.ReadInt16();
     Pins      = new DynamicMapPinInfo[PinsCount];
     for (int i = 0; i < PinsCount; i++)
     {
         Pins[i] = new DynamicMapPinInfo().Read(io);
     }
     return(this);
 }