155 references to RichTextBoxFinds
System.Windows.Forms (18)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (17)
1766
return Find(str, 0, 0,
RichTextBoxFinds
.None);
1772
public int Find(string str,
RichTextBoxFinds
options)
1780
public int Find(string str, int start,
RichTextBoxFinds
options)
1788
public unsafe int Find(string str, int start, int end,
RichTextBoxFinds
options)
1797
bool selectWord = (options &
RichTextBoxFinds
.NoHighlight) !=
RichTextBoxFinds
.NoHighlight;
1844
unsafe int FindInternal(ReadOnlySpan<char> str, int start, int end,
RichTextBoxFinds
options)
1866
if ((options &
RichTextBoxFinds
.Reverse) !=
RichTextBoxFinds
.Reverse)
1882
if ((options &
RichTextBoxFinds
.Reverse) !=
RichTextBoxFinds
.Reverse)
1896
if ((options &
RichTextBoxFinds
.WholeWord) ==
RichTextBoxFinds
.WholeWord)
1901
if ((options &
RichTextBoxFinds
.MatchCase) ==
RichTextBoxFinds
.MatchCase)
1906
if ((options &
RichTextBoxFinds
.Reverse) !=
RichTextBoxFinds
.Reverse)
System\Windows\Forms\Controls\RichTextBox\RichTextBoxFinds.cs (1)
7
/// Specifies how the <see cref="RichTextBox.Find(string,
RichTextBoxFinds
)"/> method works.
System.Windows.Forms.Tests (137)
System\Windows\Forms\RichTextBoxTests.cs (137)
7967
yield return new object[] { string.Empty, string.Empty,
RichTextBoxFinds
.None, -1 };
7968
yield return new object[] { string.Empty, "abc",
RichTextBoxFinds
.None, -1 };
7969
yield return new object[] { string.Empty, string.Empty,
RichTextBoxFinds
.Reverse, -1 };
7970
yield return new object[] { string.Empty, "abc",
RichTextBoxFinds
.Reverse, -1 };
7972
yield return new object[] { "abc", string.Empty,
RichTextBoxFinds
.None, -1 };
7973
yield return new object[] { "abc", "a",
RichTextBoxFinds
.None, 0 };
7974
yield return new object[] { "abc", "a",
RichTextBoxFinds
.Reverse, 0 };
7975
yield return new object[] { "abc", "ab",
RichTextBoxFinds
.None, 0 };
7976
yield return new object[] { "abc", "abc",
RichTextBoxFinds
.None, 0 };
7977
yield return new object[] { "abc", "abcd",
RichTextBoxFinds
.None, -1 };
7978
yield return new object[] { "abc", "b",
RichTextBoxFinds
.None, 1 };
7979
yield return new object[] { "abc", "d",
RichTextBoxFinds
.None, -1 };
7981
yield return new object[] { "abc", "ABC",
RichTextBoxFinds
.None, 0 };
7982
yield return new object[] { "abc", "abc",
RichTextBoxFinds
.MatchCase, 0 };
7983
yield return new object[] { "abc", "ABC",
RichTextBoxFinds
.MatchCase, -1 };
7985
yield return new object[] { "aa", "a",
RichTextBoxFinds
.None, 0 };
7986
yield return new object[] { "aa", "a",
RichTextBoxFinds
.Reverse, 1 };
7987
yield return new object[] { "aa", string.Empty,
RichTextBoxFinds
.Reverse, -1 };
7988
yield return new object[] { "abc def", "ef",
RichTextBoxFinds
.None, 5 };
7989
yield return new object[] { "abc def", "def",
RichTextBoxFinds
.None, 4 };
7990
yield return new object[] { "abc def", " ",
RichTextBoxFinds
.None, 3 };
7991
yield return new object[] { "abc def", "ef",
RichTextBoxFinds
.WholeWord, -1 };
7992
yield return new object[] { "abc def", "def",
RichTextBoxFinds
.WholeWord, 4 };
7993
yield return new object[] { "abc def", " ",
RichTextBoxFinds
.WholeWord, -1 };
7995
yield return new object[] { "ab\u0640cd", "abcd",
RichTextBoxFinds
.None, 0 };
7996
yield return new object[] { "ab\u0640cd", "\u0640",
RichTextBoxFinds
.None, 2 };
7997
yield return new object[] { "ab\u0640cd", "bc",
RichTextBoxFinds
.None, 1 };
7998
yield return new object[] { "ab\u0640cd", "abcd",
RichTextBoxFinds
.NoHighlight, 0 };
7999
yield return new object[] { "ab\u0640cd", "\u0640",
RichTextBoxFinds
.NoHighlight, 2 };
8000
yield return new object[] { "ab\u0640cd", "bc",
RichTextBoxFinds
.NoHighlight, 1 };
8001
yield return new object[] { "abcd", "abcd",
RichTextBoxFinds
.NoHighlight, 0 };
8006
public void RichTextBox_Find_StringRichTextBoxFinds_ReturnsExpected(string text, string str,
RichTextBoxFinds
options, int expected)
8018
yield return new object[] { string.Empty, string.Empty, 0,
RichTextBoxFinds
.None, -1 };
8019
yield return new object[] { string.Empty, "abc", 0,
RichTextBoxFinds
.None, -1 };
8020
yield return new object[] { string.Empty, string.Empty, 0,
RichTextBoxFinds
.Reverse, -1 };
8021
yield return new object[] { string.Empty, "abc", 0,
RichTextBoxFinds
.Reverse, -1 };
8023
yield return new object[] { "abc", string.Empty, 0,
RichTextBoxFinds
.None, -1 };
8024
yield return new object[] { "abc", "a", 0,
RichTextBoxFinds
.None, 0 };
8025
yield return new object[] { "abc", "a", 0,
RichTextBoxFinds
.Reverse, 0 };
8026
yield return new object[] { "abc", "ab", 0,
RichTextBoxFinds
.None, 0 };
8027
yield return new object[] { "abc", "abc", 0,
RichTextBoxFinds
.None, 0 };
8028
yield return new object[] { "abc", "abcd", 0,
RichTextBoxFinds
.None, -1 };
8029
yield return new object[] { "abc", "b", 0,
RichTextBoxFinds
.None, 1 };
8030
yield return new object[] { "abc", "d", 0,
RichTextBoxFinds
.None, -1 };
8032
yield return new object[] { "abc", "ABC", 0,
RichTextBoxFinds
.None, 0 };
8033
yield return new object[] { "abc", "abc", 0,
RichTextBoxFinds
.MatchCase, 0 };
8034
yield return new object[] { "abc", "ABC", 0,
RichTextBoxFinds
.MatchCase, -1 };
8036
yield return new object[] { "aa", "a", 0,
RichTextBoxFinds
.None, 0 };
8037
yield return new object[] { "aa", "a", 0,
RichTextBoxFinds
.Reverse, 1 };
8038
yield return new object[] { "aa", string.Empty, 0,
RichTextBoxFinds
.Reverse, -1 };
8039
yield return new object[] { "abc def", "ef", 0,
RichTextBoxFinds
.None, 5 };
8040
yield return new object[] { "abc def", "def", 0,
RichTextBoxFinds
.None, 4 };
8041
yield return new object[] { "abc def", " ", 0,
RichTextBoxFinds
.None, 3 };
8042
yield return new object[] { "abc def", "ef", 0,
RichTextBoxFinds
.WholeWord, -1 };
8043
yield return new object[] { "abc def", "def", 0,
RichTextBoxFinds
.WholeWord, 4 };
8044
yield return new object[] { "abc def", " ", 0,
RichTextBoxFinds
.WholeWord, -1 };
8046
yield return new object[] { "abc", "a", 1,
RichTextBoxFinds
.None, -1 };
8047
yield return new object[] { "abc", "a", 2,
RichTextBoxFinds
.None, -1 };
8048
yield return new object[] { "abc", "c", 2,
RichTextBoxFinds
.None, 2 };
8049
yield return new object[] { "abc", "a", 1,
RichTextBoxFinds
.Reverse, -1 };
8050
yield return new object[] { "abc", "a", 2,
RichTextBoxFinds
.Reverse, -1 };
8051
yield return new object[] { "abc", "c", 2,
RichTextBoxFinds
.Reverse, 2 };
8053
yield return new object[] { "ab\u0640cd", "abcd", 0,
RichTextBoxFinds
.None, 0 };
8054
yield return new object[] { "ab\u0640cd", "\u0640", 0,
RichTextBoxFinds
.None, 2 };
8055
yield return new object[] { "ab\u0640cd", "bc", 0,
RichTextBoxFinds
.None, 1 };
8056
yield return new object[] { "ab\u0640cd", "abcd", 0,
RichTextBoxFinds
.NoHighlight, 0 };
8057
yield return new object[] { "ab\u0640cd", "\u0640", 0,
RichTextBoxFinds
.NoHighlight, 2 };
8058
yield return new object[] { "ab\u0640cd", "bc", 0,
RichTextBoxFinds
.NoHighlight, 1 };
8059
yield return new object[] { "abcd", "abcd", 0,
RichTextBoxFinds
.NoHighlight, 0 };
8064
public void RichTextBox_Find_StringIntRichTextBoxFinds_ReturnsExpected(string text, string str, int start,
RichTextBoxFinds
options, int expected)
8078
yield return new object[] { string.Empty, string.Empty, 0, end,
RichTextBoxFinds
.None, -1 };
8079
yield return new object[] { string.Empty, "abc", 0, end,
RichTextBoxFinds
.None, -1 };
8080
yield return new object[] { string.Empty, string.Empty, 0, end,
RichTextBoxFinds
.Reverse, -1 };
8081
yield return new object[] { string.Empty, "abc", 0, end,
RichTextBoxFinds
.Reverse, -1 };
8083
yield return new object[] { "abc", string.Empty, 0, end,
RichTextBoxFinds
.None, -1 };
8084
yield return new object[] { "abc", "a", 0, end,
RichTextBoxFinds
.None, 0 };
8085
yield return new object[] { "abc", "a", 0, end,
RichTextBoxFinds
.Reverse, 0 };
8086
yield return new object[] { "abc", "ab", 0, end,
RichTextBoxFinds
.None, 0 };
8087
yield return new object[] { "abc", "abc", 0, end,
RichTextBoxFinds
.None, 0 };
8088
yield return new object[] { "abc", "abcd", 0, end,
RichTextBoxFinds
.None, -1 };
8089
yield return new object[] { "abc", "b", 0, end,
RichTextBoxFinds
.None, 1 };
8090
yield return new object[] { "abc", "d", 0, end,
RichTextBoxFinds
.None, -1 };
8092
yield return new object[] { "abc", "ABC", 0, end,
RichTextBoxFinds
.None, 0 };
8093
yield return new object[] { "abc", "abc", 0, end,
RichTextBoxFinds
.MatchCase, 0 };
8094
yield return new object[] { "abc", "ABC", 0, end,
RichTextBoxFinds
.MatchCase, -1 };
8096
yield return new object[] { "aa", "a", 0, end,
RichTextBoxFinds
.None, 0 };
8097
yield return new object[] { "aa", "a", 0, end,
RichTextBoxFinds
.Reverse, 1 };
8098
yield return new object[] { "abc", string.Empty, 0, end,
RichTextBoxFinds
.Reverse, -1 };
8099
yield return new object[] { "abc def", "ef", 0, end,
RichTextBoxFinds
.None, 5 };
8100
yield return new object[] { "abc def", "def", 0, end,
RichTextBoxFinds
.None, 4 };
8101
yield return new object[] { "abc def", " ", 0, end,
RichTextBoxFinds
.None, 3 };
8102
yield return new object[] { "abc def", "ef", 0, end,
RichTextBoxFinds
.WholeWord, -1 };
8103
yield return new object[] { "abc def", "def", 0, end,
RichTextBoxFinds
.WholeWord, 4 };
8104
yield return new object[] { "abc def", " ", 0, end,
RichTextBoxFinds
.WholeWord, -1 };
8106
yield return new object[] { "ab\u0640cd", "abcd", 0, end,
RichTextBoxFinds
.None, 0 };
8107
yield return new object[] { "ab\u0640cd", "\u0640", 0, end,
RichTextBoxFinds
.None, 2 };
8108
yield return new object[] { "ab\u0640cd", "bc", 0, end,
RichTextBoxFinds
.None, 1 };
8109
yield return new object[] { "ab\u0640cd", "abcd", 0, end,
RichTextBoxFinds
.NoHighlight, 0 };
8110
yield return new object[] { "ab\u0640cd", "\u0640", 0, end,
RichTextBoxFinds
.NoHighlight, 2 };
8111
yield return new object[] { "ab\u0640cd", "bc", 0, end,
RichTextBoxFinds
.NoHighlight, 1 };
8112
yield return new object[] { "abcd", "abcd", 0, end,
RichTextBoxFinds
.NoHighlight, 0 };
8115
yield return new object[] { "abc", "a", 1, 3,
RichTextBoxFinds
.None, -1 };
8116
yield return new object[] { "abc", "a", 2, 3,
RichTextBoxFinds
.None, -1 };
8117
yield return new object[] { "abc", "c", 2, 3,
RichTextBoxFinds
.None, 2 };
8118
yield return new object[] { "abc", "a", 1, 3,
RichTextBoxFinds
.Reverse, -1 };
8119
yield return new object[] { "abc", "a", 2, 3,
RichTextBoxFinds
.Reverse, -1 };
8120
yield return new object[] { "abc", "c", 2, 3,
RichTextBoxFinds
.Reverse, 2 };
8122
yield return new object[] { "abc", "c", 0, 5,
RichTextBoxFinds
.None, 2 };
8123
yield return new object[] { "abc", "c", 0, 2,
RichTextBoxFinds
.None, -1 };
8128
public void RichTextBox_Find_StringIntIntRichTextBoxFinds_ReturnsExpected(string text, string str, int start, int end,
RichTextBoxFinds
options, int expected)
8163
public void RichTextBox_Find_StringRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str,
RichTextBoxFinds
options, int expected)
8186
public void RichTextBox_Find_StringIntRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str, int start,
RichTextBoxFinds
options, int expected)
8209
public void RichTextBox_Find_StringIntIntRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str, int start, int end,
RichTextBoxFinds
options, int expected)
8432
Assert.Throws<ArgumentNullException>("str", () => control.Find(null,
RichTextBoxFinds
.None));
8433
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0,
RichTextBoxFinds
.None));
8434
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1,
RichTextBoxFinds
.None));
8435
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1,
RichTextBoxFinds
.None));
8436
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0,
RichTextBoxFinds
.None));
8437
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0,
RichTextBoxFinds
.None));
8438
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1, 0,
RichTextBoxFinds
.None));
8439
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2,
RichTextBoxFinds
.None));
8450
Assert.Throws<ArgumentNullException>("str", () => control.Find(null,
RichTextBoxFinds
.None));
8451
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0,
RichTextBoxFinds
.None));
8452
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1,
RichTextBoxFinds
.None));
8453
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2,
RichTextBoxFinds
.None));
8454
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0,
RichTextBoxFinds
.None));
8455
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0,
RichTextBoxFinds
.None));
8456
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2, 0,
RichTextBoxFinds
.None));
8457
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2,
RichTextBoxFinds
.None));
8497
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start,
RichTextBoxFinds
.NoHighlight));
8498
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0,
RichTextBoxFinds
.NoHighlight));
8512
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start,
RichTextBoxFinds
.NoHighlight));
8513
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0,
RichTextBoxFinds
.NoHighlight));
8522
Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2,
RichTextBoxFinds
.NoHighlight));
8533
Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2,
RichTextBoxFinds
.NoHighlight));
8544
Assert.Throws<ArgumentException>(() => control.Find("s", 1, 0,
RichTextBoxFinds
.None));
8545
Assert.Throws<ArgumentException>(() => control.Find("s", 1, 0,
RichTextBoxFinds
.Reverse));