コード例 #1
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hashCode = isAtEndOfLine ? 115817 : 0;

            unchecked {
                hashCode += 1000000007 * Line.GetHashCode();
                hashCode += 1000000009 * Column.GetHashCode();
                hashCode += 1000000021 * VisualColumn.GetHashCode();
            }
            return(hashCode);
        }
コード例 #2
0
        /// <inheritdoc />
        public int CompareTo(TextViewPosition other)
        {
            var r = Location.CompareTo(other.Location);

            if (r != 0)
            {
                return(r);
            }
            r = VisualColumn.CompareTo(other.VisualColumn);
            if (r != 0)
            {
                return(r);
            }
            if (IsAtEndOfLine && !other.IsAtEndOfLine)
            {
                return(-1);
            }
            if (!IsAtEndOfLine && other.IsAtEndOfLine)
            {
                return(1);
            }
            return(0);
        }