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)
7969
yield return new object[] { string.Empty, string.Empty,
RichTextBoxFinds
.None, -1 };
7970
yield return new object[] { string.Empty, "abc",
RichTextBoxFinds
.None, -1 };
7971
yield return new object[] { string.Empty, string.Empty,
RichTextBoxFinds
.Reverse, -1 };
7972
yield return new object[] { string.Empty, "abc",
RichTextBoxFinds
.Reverse, -1 };
7974
yield return new object[] { "abc", string.Empty,
RichTextBoxFinds
.None, -1 };
7975
yield return new object[] { "abc", "a",
RichTextBoxFinds
.None, 0 };
7976
yield return new object[] { "abc", "a",
RichTextBoxFinds
.Reverse, 0 };
7977
yield return new object[] { "abc", "ab",
RichTextBoxFinds
.None, 0 };
7978
yield return new object[] { "abc", "abc",
RichTextBoxFinds
.None, 0 };
7979
yield return new object[] { "abc", "abcd",
RichTextBoxFinds
.None, -1 };
7980
yield return new object[] { "abc", "b",
RichTextBoxFinds
.None, 1 };
7981
yield return new object[] { "abc", "d",
RichTextBoxFinds
.None, -1 };
7983
yield return new object[] { "abc", "ABC",
RichTextBoxFinds
.None, 0 };
7984
yield return new object[] { "abc", "abc",
RichTextBoxFinds
.MatchCase, 0 };
7985
yield return new object[] { "abc", "ABC",
RichTextBoxFinds
.MatchCase, -1 };
7987
yield return new object[] { "aa", "a",
RichTextBoxFinds
.None, 0 };
7988
yield return new object[] { "aa", "a",
RichTextBoxFinds
.Reverse, 1 };
7989
yield return new object[] { "aa", string.Empty,
RichTextBoxFinds
.Reverse, -1 };
7990
yield return new object[] { "abc def", "ef",
RichTextBoxFinds
.None, 5 };
7991
yield return new object[] { "abc def", "def",
RichTextBoxFinds
.None, 4 };
7992
yield return new object[] { "abc def", " ",
RichTextBoxFinds
.None, 3 };
7993
yield return new object[] { "abc def", "ef",
RichTextBoxFinds
.WholeWord, -1 };
7994
yield return new object[] { "abc def", "def",
RichTextBoxFinds
.WholeWord, 4 };
7995
yield return new object[] { "abc def", " ",
RichTextBoxFinds
.WholeWord, -1 };
7997
yield return new object[] { "ab\u0640cd", "abcd",
RichTextBoxFinds
.None, 0 };
7998
yield return new object[] { "ab\u0640cd", "\u0640",
RichTextBoxFinds
.None, 2 };
7999
yield return new object[] { "ab\u0640cd", "bc",
RichTextBoxFinds
.None, 1 };
8000
yield return new object[] { "ab\u0640cd", "abcd",
RichTextBoxFinds
.NoHighlight, 0 };
8001
yield return new object[] { "ab\u0640cd", "\u0640",
RichTextBoxFinds
.NoHighlight, 2 };
8002
yield return new object[] { "ab\u0640cd", "bc",
RichTextBoxFinds
.NoHighlight, 1 };
8003
yield return new object[] { "abcd", "abcd",
RichTextBoxFinds
.NoHighlight, 0 };
8008
public void RichTextBox_Find_StringRichTextBoxFinds_ReturnsExpected(string text, string str,
RichTextBoxFinds
options, int expected)
8020
yield return new object[] { string.Empty, string.Empty, 0,
RichTextBoxFinds
.None, -1 };
8021
yield return new object[] { string.Empty, "abc", 0,
RichTextBoxFinds
.None, -1 };
8022
yield return new object[] { string.Empty, string.Empty, 0,
RichTextBoxFinds
.Reverse, -1 };
8023
yield return new object[] { string.Empty, "abc", 0,
RichTextBoxFinds
.Reverse, -1 };
8025
yield return new object[] { "abc", string.Empty, 0,
RichTextBoxFinds
.None, -1 };
8026
yield return new object[] { "abc", "a", 0,
RichTextBoxFinds
.None, 0 };
8027
yield return new object[] { "abc", "a", 0,
RichTextBoxFinds
.Reverse, 0 };
8028
yield return new object[] { "abc", "ab", 0,
RichTextBoxFinds
.None, 0 };
8029
yield return new object[] { "abc", "abc", 0,
RichTextBoxFinds
.None, 0 };
8030
yield return new object[] { "abc", "abcd", 0,
RichTextBoxFinds
.None, -1 };
8031
yield return new object[] { "abc", "b", 0,
RichTextBoxFinds
.None, 1 };
8032
yield return new object[] { "abc", "d", 0,
RichTextBoxFinds
.None, -1 };
8034
yield return new object[] { "abc", "ABC", 0,
RichTextBoxFinds
.None, 0 };
8035
yield return new object[] { "abc", "abc", 0,
RichTextBoxFinds
.MatchCase, 0 };
8036
yield return new object[] { "abc", "ABC", 0,
RichTextBoxFinds
.MatchCase, -1 };
8038
yield return new object[] { "aa", "a", 0,
RichTextBoxFinds
.None, 0 };
8039
yield return new object[] { "aa", "a", 0,
RichTextBoxFinds
.Reverse, 1 };
8040
yield return new object[] { "aa", string.Empty, 0,
RichTextBoxFinds
.Reverse, -1 };
8041
yield return new object[] { "abc def", "ef", 0,
RichTextBoxFinds
.None, 5 };
8042
yield return new object[] { "abc def", "def", 0,
RichTextBoxFinds
.None, 4 };
8043
yield return new object[] { "abc def", " ", 0,
RichTextBoxFinds
.None, 3 };
8044
yield return new object[] { "abc def", "ef", 0,
RichTextBoxFinds
.WholeWord, -1 };
8045
yield return new object[] { "abc def", "def", 0,
RichTextBoxFinds
.WholeWord, 4 };
8046
yield return new object[] { "abc def", " ", 0,
RichTextBoxFinds
.WholeWord, -1 };
8048
yield return new object[] { "abc", "a", 1,
RichTextBoxFinds
.None, -1 };
8049
yield return new object[] { "abc", "a", 2,
RichTextBoxFinds
.None, -1 };
8050
yield return new object[] { "abc", "c", 2,
RichTextBoxFinds
.None, 2 };
8051
yield return new object[] { "abc", "a", 1,
RichTextBoxFinds
.Reverse, -1 };
8052
yield return new object[] { "abc", "a", 2,
RichTextBoxFinds
.Reverse, -1 };
8053
yield return new object[] { "abc", "c", 2,
RichTextBoxFinds
.Reverse, 2 };
8055
yield return new object[] { "ab\u0640cd", "abcd", 0,
RichTextBoxFinds
.None, 0 };
8056
yield return new object[] { "ab\u0640cd", "\u0640", 0,
RichTextBoxFinds
.None, 2 };
8057
yield return new object[] { "ab\u0640cd", "bc", 0,
RichTextBoxFinds
.None, 1 };
8058
yield return new object[] { "ab\u0640cd", "abcd", 0,
RichTextBoxFinds
.NoHighlight, 0 };
8059
yield return new object[] { "ab\u0640cd", "\u0640", 0,
RichTextBoxFinds
.NoHighlight, 2 };
8060
yield return new object[] { "ab\u0640cd", "bc", 0,
RichTextBoxFinds
.NoHighlight, 1 };
8061
yield return new object[] { "abcd", "abcd", 0,
RichTextBoxFinds
.NoHighlight, 0 };
8066
public void RichTextBox_Find_StringIntRichTextBoxFinds_ReturnsExpected(string text, string str, int start,
RichTextBoxFinds
options, int expected)
8080
yield return new object[] { string.Empty, string.Empty, 0, end,
RichTextBoxFinds
.None, -1 };
8081
yield return new object[] { string.Empty, "abc", 0, end,
RichTextBoxFinds
.None, -1 };
8082
yield return new object[] { string.Empty, string.Empty, 0, end,
RichTextBoxFinds
.Reverse, -1 };
8083
yield return new object[] { string.Empty, "abc", 0, end,
RichTextBoxFinds
.Reverse, -1 };
8085
yield return new object[] { "abc", string.Empty, 0, end,
RichTextBoxFinds
.None, -1 };
8086
yield return new object[] { "abc", "a", 0, end,
RichTextBoxFinds
.None, 0 };
8087
yield return new object[] { "abc", "a", 0, end,
RichTextBoxFinds
.Reverse, 0 };
8088
yield return new object[] { "abc", "ab", 0, end,
RichTextBoxFinds
.None, 0 };
8089
yield return new object[] { "abc", "abc", 0, end,
RichTextBoxFinds
.None, 0 };
8090
yield return new object[] { "abc", "abcd", 0, end,
RichTextBoxFinds
.None, -1 };
8091
yield return new object[] { "abc", "b", 0, end,
RichTextBoxFinds
.None, 1 };
8092
yield return new object[] { "abc", "d", 0, end,
RichTextBoxFinds
.None, -1 };
8094
yield return new object[] { "abc", "ABC", 0, end,
RichTextBoxFinds
.None, 0 };
8095
yield return new object[] { "abc", "abc", 0, end,
RichTextBoxFinds
.MatchCase, 0 };
8096
yield return new object[] { "abc", "ABC", 0, end,
RichTextBoxFinds
.MatchCase, -1 };
8098
yield return new object[] { "aa", "a", 0, end,
RichTextBoxFinds
.None, 0 };
8099
yield return new object[] { "aa", "a", 0, end,
RichTextBoxFinds
.Reverse, 1 };
8100
yield return new object[] { "abc", string.Empty, 0, end,
RichTextBoxFinds
.Reverse, -1 };
8101
yield return new object[] { "abc def", "ef", 0, end,
RichTextBoxFinds
.None, 5 };
8102
yield return new object[] { "abc def", "def", 0, end,
RichTextBoxFinds
.None, 4 };
8103
yield return new object[] { "abc def", " ", 0, end,
RichTextBoxFinds
.None, 3 };
8104
yield return new object[] { "abc def", "ef", 0, end,
RichTextBoxFinds
.WholeWord, -1 };
8105
yield return new object[] { "abc def", "def", 0, end,
RichTextBoxFinds
.WholeWord, 4 };
8106
yield return new object[] { "abc def", " ", 0, end,
RichTextBoxFinds
.WholeWord, -1 };
8108
yield return new object[] { "ab\u0640cd", "abcd", 0, end,
RichTextBoxFinds
.None, 0 };
8109
yield return new object[] { "ab\u0640cd", "\u0640", 0, end,
RichTextBoxFinds
.None, 2 };
8110
yield return new object[] { "ab\u0640cd", "bc", 0, end,
RichTextBoxFinds
.None, 1 };
8111
yield return new object[] { "ab\u0640cd", "abcd", 0, end,
RichTextBoxFinds
.NoHighlight, 0 };
8112
yield return new object[] { "ab\u0640cd", "\u0640", 0, end,
RichTextBoxFinds
.NoHighlight, 2 };
8113
yield return new object[] { "ab\u0640cd", "bc", 0, end,
RichTextBoxFinds
.NoHighlight, 1 };
8114
yield return new object[] { "abcd", "abcd", 0, end,
RichTextBoxFinds
.NoHighlight, 0 };
8117
yield return new object[] { "abc", "a", 1, 3,
RichTextBoxFinds
.None, -1 };
8118
yield return new object[] { "abc", "a", 2, 3,
RichTextBoxFinds
.None, -1 };
8119
yield return new object[] { "abc", "c", 2, 3,
RichTextBoxFinds
.None, 2 };
8120
yield return new object[] { "abc", "a", 1, 3,
RichTextBoxFinds
.Reverse, -1 };
8121
yield return new object[] { "abc", "a", 2, 3,
RichTextBoxFinds
.Reverse, -1 };
8122
yield return new object[] { "abc", "c", 2, 3,
RichTextBoxFinds
.Reverse, 2 };
8124
yield return new object[] { "abc", "c", 0, 5,
RichTextBoxFinds
.None, 2 };
8125
yield return new object[] { "abc", "c", 0, 2,
RichTextBoxFinds
.None, -1 };
8130
public void RichTextBox_Find_StringIntIntRichTextBoxFinds_ReturnsExpected(string text, string str, int start, int end,
RichTextBoxFinds
options, int expected)
8165
public void RichTextBox_Find_StringRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str,
RichTextBoxFinds
options, int expected)
8188
public void RichTextBox_Find_StringIntRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str, int start,
RichTextBoxFinds
options, int expected)
8211
public void RichTextBox_Find_StringIntIntRichTextBoxFindsWithHandle_ReturnsExpected(string text, string str, int start, int end,
RichTextBoxFinds
options, int expected)
8434
Assert.Throws<ArgumentNullException>("str", () => control.Find(null,
RichTextBoxFinds
.None));
8435
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0,
RichTextBoxFinds
.None));
8436
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1,
RichTextBoxFinds
.None));
8437
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1,
RichTextBoxFinds
.None));
8438
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0,
RichTextBoxFinds
.None));
8439
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0,
RichTextBoxFinds
.None));
8440
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 1, 0,
RichTextBoxFinds
.None));
8441
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2,
RichTextBoxFinds
.None));
8452
Assert.Throws<ArgumentNullException>("str", () => control.Find(null,
RichTextBoxFinds
.None));
8453
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0,
RichTextBoxFinds
.None));
8454
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1,
RichTextBoxFinds
.None));
8455
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2,
RichTextBoxFinds
.None));
8456
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, 0,
RichTextBoxFinds
.None));
8457
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, -1, 0,
RichTextBoxFinds
.None));
8458
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 2, 0,
RichTextBoxFinds
.None));
8459
Assert.Throws<ArgumentNullException>("str", () => control.Find(null, 0, -2,
RichTextBoxFinds
.None));
8499
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start,
RichTextBoxFinds
.NoHighlight));
8500
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0,
RichTextBoxFinds
.NoHighlight));
8514
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start,
RichTextBoxFinds
.NoHighlight));
8515
Assert.Throws<ArgumentOutOfRangeException>("start", () => control.Find("s", start, 0,
RichTextBoxFinds
.NoHighlight));
8524
Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2,
RichTextBoxFinds
.NoHighlight));
8535
Assert.Throws<ArgumentOutOfRangeException>("end", () => control.Find("s", 0, -2,
RichTextBoxFinds
.NoHighlight));
8546
Assert.Throws<ArgumentException>(() => control.Find("s", 1, 0,
RichTextBoxFinds
.None));
8547
Assert.Throws<ArgumentException>(() => control.Find("s", 1, 0,
RichTextBoxFinds
.Reverse));