public override bool Equals(Object that) { if(that is BaseCommand) { BaseCommand thatCommand = (BaseCommand) that; return this.GetDataStructureType() == thatCommand.GetDataStructureType() && this.CommandId == thatCommand.CommandId; } return false; }