bool ITextRangeProvider.Compare(ITextRangeProvider range)
        {
            // TextPatternRange already verifies the other range comes from the same element before forwarding so we only need to worry about
            // whether the endpoints are identical.
            WindowsEditBoxRange editRange = (WindowsEditBoxRange)range;

            return(editRange.Start == Start && editRange.End == End);
        }
        int ITextRangeProvider.CompareEndpoints(TextPatternRangeEndpoint endpoint, ITextRangeProvider targetRange, TextPatternRangeEndpoint targetEndpoint)
        {
            // TextPatternRange already verifies the other range comes from the same element before forwarding so we only need to worry about
            // comparing the endpoints.
            WindowsEditBoxRange editRange = (WindowsEditBoxRange)targetRange;
            int e1 = (endpoint == TextPatternRangeEndpoint.Start) ? Start : End;
            int e2 = (targetEndpoint == TextPatternRangeEndpoint.Start) ? editRange.Start : editRange.End;

            return(e1 - e2);
        }
        void ITextRangeProvider.MoveEndpointByRange(TextPatternRangeEndpoint endpoint, ITextRangeProvider targetRange, TextPatternRangeEndpoint targetEndpoint)
        {
            Misc.SetFocus(_provider._hwnd);

            // TextPatternRange already verifies the other range comes from the same element before forwarding so we only need to worry
            // about the endpoints.
            WindowsEditBoxRange editRange = (WindowsEditBoxRange)targetRange;
            int e = (targetEndpoint == TextPatternRangeEndpoint.Start) ? editRange.Start : editRange.End;

            if (endpoint == TextPatternRangeEndpoint.Start)
            {
                Start = e;
            }
            else
            {
                End = e;
            }
        }