public void Register(ref ToeMessageDescription message) { if (!this.map.ContainsKey(message.Id)) { this.map.Add(message.Id, this.messages.Count); this.messages.Add(message); return; } if (this.messages[this.map[message.Id]] != message) { throw new ToeException(string.Format("Different version of message {0} registered already", message.Name)); } }
public bool Equals(ToeMessageDescription other) { if (other.id != this.id) { return false; } if (other.fields.Length != this.fields.Length) { return false; } for (int index = 0; index < this.fields.Length; index++) { if (this.fields[index] != other.fields[index]) { return false; } } return true; }