76 references to TextUnit
System.Windows.Forms.Primitives (48)
System\Windows\Forms\Automation\UiaTextRange.cs (29)
169HRESULT ITextRangeProvider.Interface.ExpandToEnclosingUnit(TextUnit unit) 173case TextUnit.TextUnit_Character: 177End = MoveEndpointForward(End, TextUnit.TextUnit_Character, 1, out _); 182case TextUnit.TextUnit_Word: 205case TextUnit.TextUnit_Line: 234case TextUnit.TextUnit_Paragraph: 257case TextUnit.TextUnit_Format: 258case TextUnit.TextUnit_Page: 259case TextUnit.TextUnit_Document: 446HRESULT ITextRangeProvider.Interface.Move(TextUnit unit, int count, int* pRetVal) 504HRESULT ITextRangeProvider.Interface.MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int* pRetVal) 927private int MoveEndpointForward(int index, TextUnit unit, int count, out int moved) 931case TextUnit.TextUnit_Character: 944case TextUnit.TextUnit_Word: 965case TextUnit.TextUnit_Line: 992case TextUnit.TextUnit_Paragraph: 1015case TextUnit.TextUnit_Format: 1016case TextUnit.TextUnit_Page: 1017case TextUnit.TextUnit_Document: 1034throw new InvalidEnumArgumentException(nameof(unit), (int)unit, typeof(TextUnit)); 1043private int MoveEndpointBackward(int index, TextUnit unit, int count, out int moved) 1047case TextUnit.TextUnit_Character: 1058case TextUnit.TextUnit_Word: 1076case TextUnit.TextUnit_Line: 1127case TextUnit.TextUnit_Paragraph: 1147case TextUnit.TextUnit_Format: 1148case TextUnit.TextUnit_Page: 1149case TextUnit.TextUnit_Document: 1164throw new InvalidEnumArgumentException(nameof(unit), (int)unit, typeof(TextUnit));
Windows.Win32.ITextRangeProvider.g.cs (15)
167 private static winmdroot.Foundation.HRESULT ExpandToEnclosingUnit(ITextRangeProvider* pThis, winmdroot.UI.Accessibility.TextUnit unit) 198 public void ExpandToEnclosingUnit(winmdroot.UI.Accessibility.TextUnit unit) 200 ((delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextUnit ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((ITextRangeProvider*)Unsafe.AsPointer(ref this), unit).ThrowOnFailure(); 435 private static winmdroot.Foundation.HRESULT Move(ITextRangeProvider* pThis, winmdroot.UI.Accessibility.TextUnit unit, int count, int* pRetVal) 467 public int Move(winmdroot.UI.Accessibility.TextUnit unit, int count) 470 ((delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextUnit ,int ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[13])((ITextRangeProvider*)Unsafe.AsPointer(ref this), unit, count, &__retVal).ThrowOnFailure(); 477 private static winmdroot.Foundation.HRESULT MoveEndpointByUnit(ITextRangeProvider* pThis, winmdroot.UI.Accessibility.TextPatternRangeEndpoint endpoint, winmdroot.UI.Accessibility.TextUnit unit, int count, int* pRetVal) 507 public int MoveEndpointByUnit(winmdroot.UI.Accessibility.TextPatternRangeEndpoint endpoint, winmdroot.UI.Accessibility.TextUnit unit, int count) 510 ((delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextPatternRangeEndpoint ,winmdroot.UI.Accessibility.TextUnit ,int ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((ITextRangeProvider*)Unsafe.AsPointer(ref this), endpoint, unit, count, &__retVal).ThrowOnFailure(); 748 internal delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextUnit ,winmdroot.Foundation.HRESULT> ExpandToEnclosingUnit_7; 762 internal delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextUnit ,int ,int* ,winmdroot.Foundation.HRESULT> Move_14; 764 internal delegate *unmanaged [Stdcall]<ITextRangeProvider*,winmdroot.UI.Accessibility.TextPatternRangeEndpoint ,winmdroot.UI.Accessibility.TextUnit ,int ,int* ,winmdroot.Foundation.HRESULT> MoveEndpointByUnit_15; 829winmdroot.Foundation.HRESULT ExpandToEnclosingUnit(winmdroot.UI.Accessibility.TextUnit unit); 850 unsafe winmdroot.Foundation.HRESULT Move(winmdroot.UI.Accessibility.TextUnit unit, int count, int* pRetVal); 853 unsafe winmdroot.Foundation.HRESULT MoveEndpointByUnit(winmdroot.UI.Accessibility.TextPatternRangeEndpoint endpoint, winmdroot.UI.Accessibility.TextUnit unit, int count, int* pRetVal);
Windows.Win32.UI_Accessibility_ITextRangeProvider_Extensions.g.cs (4)
63 /// <inheritdoc cref="winmdroot.UI.Accessibility.ITextRangeProvider.Interface.Move(winmdroot.UI.Accessibility.TextUnit, int, int*)"/> 64 internal static unsafe winmdroot.Foundation.HRESULT Move(this winmdroot.UI.Accessibility.ITextRangeProvider.Interface @this, winmdroot.UI.Accessibility.TextUnit unit, int count, out int pRetVal) 73 /// <inheritdoc cref="winmdroot.UI.Accessibility.ITextRangeProvider.Interface.MoveEndpointByUnit(winmdroot.UI.Accessibility.TextPatternRangeEndpoint, winmdroot.UI.Accessibility.TextUnit, int, int*)"/> 74 internal static unsafe winmdroot.Foundation.HRESULT MoveEndpointByUnit(this winmdroot.UI.Accessibility.ITextRangeProvider.Interface @this, winmdroot.UI.Accessibility.TextPatternRangeEndpoint endpoint, winmdroot.UI.Accessibility.TextUnit unit, int count, out int pRetVal)
System.Windows.Forms.Primitives.Tests (28)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (28)
293Assert.True(((ITextRangeProvider.Interface)textRange).ExpandToEnclosingUnit(TextUnit.TextUnit_Character).Succeeded); 311Assert.True(((ITextRangeProvider.Interface)textRange).ExpandToEnclosingUnit(TextUnit.TextUnit_Word).Succeeded); 342Assert.True(((ITextRangeProvider.Interface)textRange).ExpandToEnclosingUnit(TextUnit.TextUnit_Line).Succeeded); 363Assert.True(((ITextRangeProvider.Interface)textRange).ExpandToEnclosingUnit(TextUnit.TextUnit_Paragraph).Succeeded); 370yield return new object[] { 5, 8, TextUnit.TextUnit_Page, 0, 72 }; 371yield return new object[] { 10, 10, TextUnit.TextUnit_Format, 0, 72 }; 372yield return new object[] { 10, 10, TextUnit.TextUnit_Document, 0, 72 }; 377internal void UiaTextRange_ITextRangeProvider_ExpandToEnclosingUnit_ExpandsToAllText(int start, int end, TextUnit textUnit, int expandedStart, int expandedEnd) 883yield return new object[] { 0, 5, TextUnit.TextUnit_Character, 1, 6, 6 }; 884yield return new object[] { 1, 6, TextUnit.TextUnit_Character, 5, 11, 11 }; 885yield return new object[] { 0, 5, TextUnit.TextUnit_Character, -2, 0, 0 }; 886yield return new object[] { 3, 6, TextUnit.TextUnit_Character, -2, 1, 1 }; 887yield return new object[] { 1, 2, TextUnit.TextUnit_Word, 1, 4, 4 }; 888yield return new object[] { 1, 2, TextUnit.TextUnit_Word, 5, 11, 11 }; 889yield return new object[] { 12, 14, TextUnit.TextUnit_Word, -2, 8, 8 }; 890yield return new object[] { 12, 14, TextUnit.TextUnit_Word, -10, 0, 0 }; 895internal void UiaTextRange_ITextRangeProvider_Move_MovesCorrectly(int start, int end, TextUnit unit, int count, int expectedStart, int expectedEnd) 915yield return new object[] { 0, 5, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Character, 1, 1, 5 }; 916yield return new object[] { 1, 6, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Character, 5, 6, 6 }; 917yield return new object[] { 0, 5, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Character, -2, 0, 5 }; 918yield return new object[] { 3, 6, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Character, -2, 1, 6 }; 919yield return new object[] { 3, 6, TextPatternRangeEndpoint.TextPatternRangeEndpoint_End, TextUnit.TextUnit_Character, 1, 3, 7 }; 920yield return new object[] { 3, 6, TextPatternRangeEndpoint.TextPatternRangeEndpoint_End, TextUnit.TextUnit_Character, -1, 3, 5 }; 921yield return new object[] { 1, 2, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Word, 1, 4, 4 }; 922yield return new object[] { 1, 2, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Word, 5, 11, 11 }; 923yield return new object[] { 12, 14, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Word, -1, 11, 14 }; 924yield return new object[] { 12, 14, TextPatternRangeEndpoint.TextPatternRangeEndpoint_Start, TextUnit.TextUnit_Word, -2, 8, 14 }; 929internal void UiaTextRange_ITextRangeProvider_MoveEndpointByUnit_MovesCorrectly(int start, int end, TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int expectedStart, int expectedEnd)