Пример #1
0
        public void FromBytes(byte[] bytes)
        {
            foreach (KeyValuePair <DataKey, CMChannelMap> pair in channels)
            {
                CMChannelMap map = pair.Value;

                map.SetValueFromBytes(bytes, this);
            }
        }
Пример #2
0
        public byte[] GetBytes()
        {
            foreach (KeyValuePair <DataKey, CMChannelMap> pair in channels)
            {
                CMChannelMap map        = pair.Value;
                byte[]       valueBytes = map.GetBytes(this);

                if (valueBytes != null)
                {
                    valueBytes.CopyTo(packet, map.offset);
                }
            }

            return(packet);
        }