public void FromBytes(byte[] bytes) { foreach (KeyValuePair <DataKey, CMChannelMap> pair in channels) { CMChannelMap map = pair.Value; map.SetValueFromBytes(bytes, this); } }
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); }