Skip to content

Commit

Permalink
Added Xml Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Oct 17, 2017
1 parent c279a20 commit c15f0a6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
4 changes: 1 addition & 3 deletions source/FilterTreeView/FilterTreeView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@
<ItemGroup>
<Resource Include="Resources\Locations\appbar.chess.rook.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
1 change: 1 addition & 0 deletions source/FilterTreeView/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<TextBox Grid.Column="0" Margin="3"
Text="{Binding SearchString}"
x:Name="FilterTextBox"
ToolTip="Enter at least 3 chracters"
behav:TextChangedCommand.ChangedCommand="{Binding SearchCommand}"
/>

Expand Down
37 changes: 37 additions & 0 deletions source/FilterTreeView/SearchModels/SearchParams.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
namespace FilterTreeView.SearchModels
{
/// <summary>
/// Implements a search object that contains the search string,
/// related options, as well as methods to determine whether a
/// given string is a match against the string or not.
/// </summary>
internal class SearchParams
{
#region constructors
/// <summary>
/// Class constructor
/// </summary>
public SearchParams(
string searchString
, Enums.SearchMatch match)
Expand All @@ -12,6 +20,9 @@ string searchString
Match = match;
}

/// <summary>
/// Class constructor
/// </summary>
public SearchParams()
{
SearchString = string.Empty;
Expand All @@ -21,10 +32,19 @@ public SearchParams()
#endregion constructors

#region properties
/// <summary>
/// Gets the plain text string being searched or filtered.
/// </summary>
public string SearchString { get; private set; }

/// <summary>
/// Gets the string being searched or filtered.
/// </summary>
public Enums.SearchMatch Match { get; private set; }

/// <summary>
/// Gets whether search string contains actual content or not.
/// </summary>
public bool IsSearchStringEmpty
{
get
Expand All @@ -33,10 +53,20 @@ public bool IsSearchStringEmpty
}
}

/// <summary>
/// Gets the minimal search string length required.
/// Any string shorter than this will not be searched at all.
/// </summary>
public int MinimalSearchStringLength { get; }
#endregion properties

#region methods
/// <summary>
/// Determines if a given string is considered a match in comparison
/// to the search string and its options or not.
/// </summary>
/// <param name="stringToFind"></param>
/// <returns>true if <paramref name="stringToFind"/>is a match, otherwise false</returns>
public bool MatchSearchString(string stringToFind)
{
stringToFind = (stringToFind == null ? string.Empty : stringToFind);
Expand All @@ -57,11 +87,18 @@ public bool MatchSearchString(string stringToFind)
}
}

/// <summary>
/// Can be called to trim the search string before matching takes place.
/// </summary>
public void SearchStringTrim()
{
SearchString = SearchString.Trim();
}

/// <summary>
/// Can be called to convert the search string
/// to upper case before matching takes place.
/// </summary>
public void SearchStringToUpperCase()
{
SearchString = SearchString.ToUpper();
Expand Down
5 changes: 5 additions & 0 deletions source/FilterTreeView/ViewModels/Search/BackupNodeSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
using System.Windows;
using System.Windows.Threading;

/// <summary>
/// Implements a set of methods to search and filter through backup nodes
/// and make them visible for binding only if the node is regarded as a match
/// against the search criteria.
/// </summary>
internal class BackupNodeSearch
{
private static DispatcherPriority _ChildrenEditPrio = DispatcherPriority.DataBind;
Expand Down

0 comments on commit c15f0a6

Please sign in to comment.