11namespace FilterTreeView . SearchModels
22{
3+ /// <summary>
4+ /// Implements a search object that contains the search string,
5+ /// related options, as well as methods to determine whether a
6+ /// given string is a match against the string or not.
7+ /// </summary>
38 internal class SearchParams
49 {
510 #region constructors
11+ /// <summary>
12+ /// Class constructor
13+ /// </summary>
614 public SearchParams (
715 string searchString
816 , Enums . SearchMatch match )
@@ -12,6 +20,9 @@ string searchString
1220 Match = match ;
1321 }
1422
23+ /// <summary>
24+ /// Class constructor
25+ /// </summary>
1526 public SearchParams ( )
1627 {
1728 SearchString = string . Empty ;
@@ -21,10 +32,19 @@ public SearchParams()
2132 #endregion constructors
2233
2334 #region properties
35+ /// <summary>
36+ /// Gets the plain text string being searched or filtered.
37+ /// </summary>
2438 public string SearchString { get ; private set ; }
2539
40+ /// <summary>
41+ /// Gets the string being searched or filtered.
42+ /// </summary>
2643 public Enums . SearchMatch Match { get ; private set ; }
2744
45+ /// <summary>
46+ /// Gets whether search string contains actual content or not.
47+ /// </summary>
2848 public bool IsSearchStringEmpty
2949 {
3050 get
@@ -33,10 +53,20 @@ public bool IsSearchStringEmpty
3353 }
3454 }
3555
56+ /// <summary>
57+ /// Gets the minimal search string length required.
58+ /// Any string shorter than this will not be searched at all.
59+ /// </summary>
3660 public int MinimalSearchStringLength { get ; }
3761 #endregion properties
3862
3963 #region methods
64+ /// <summary>
65+ /// Determines if a given string is considered a match in comparison
66+ /// to the search string and its options or not.
67+ /// </summary>
68+ /// <param name="stringToFind"></param>
69+ /// <returns>true if <paramref name="stringToFind"/>is a match, otherwise false</returns>
4070 public bool MatchSearchString ( string stringToFind )
4171 {
4272 stringToFind = ( stringToFind == null ? string . Empty : stringToFind ) ;
@@ -57,11 +87,18 @@ public bool MatchSearchString(string stringToFind)
5787 }
5888 }
5989
90+ /// <summary>
91+ /// Can be called to trim the search string before matching takes place.
92+ /// </summary>
6093 public void SearchStringTrim ( )
6194 {
6295 SearchString = SearchString . Trim ( ) ;
6396 }
6497
98+ /// <summary>
99+ /// Can be called to convert the search string
100+ /// to upper case before matching takes place.
101+ /// </summary>
65102 public void SearchStringToUpperCase ( )
66103 {
67104 SearchString = SearchString . ToUpper ( ) ;
0 commit comments