/// <summary> /// Checks whether this selection refers to the same spatial objects as /// another selection, and has the same reference position. /// </summary> /// <param name="that">The selection to compare with</param> /// <returns>True if the two selections refer to the same spatial objects (not /// necessarily in the same order)</returns> public bool Equals(ISpatialSelection that) { // The same spatial objects have to be involved if (!SpatialSelection.Equals(this, that)) return false; // If both selections refer to the same divider (or null), they're the same Selection other = (that as Selection); if (other == null) return false; IDivider d1 = (this.m_Section == null ? null : this.m_Section.Divider); IDivider d2 = (other.m_Section == null ? null : other.m_Section.Divider); return Object.ReferenceEquals(d1, d2); }