public int Size() { // 7 indicates sizeof(byte) * 5 + sizeof(UInt16) int size = sizeof(byte) * 7; for (int i = 0; i < this.MessageIdCount; i++) { size += sizeof(ulong); } return size; } }