public bool Equals(CodeString other) { if (other == null) { return(false); } return((Code == null && other.Code == null) || (Code != null && Code.Equals(other.Code) && CaretPosition.Equals(other.CaretPosition))); }