Skip to content

Commit

Permalink
Merge branch 'private-dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
NizamLZ committed Aug 30, 2017
2 parents 7696d03 + e9414ef commit 026aa60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions ANAConversationStudio/Helpers/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public static Models.ChatFlowSearchItem SearchNode(this ChatNode node, string se
}
public static bool IsMatch(this string text, string searchKeywords)
{
if (string.IsNullOrWhiteSpace(text) || string.IsNullOrWhiteSpace(searchKeywords)) return false;
return Regex.IsMatch(text,
string.Join("|", searchKeywords.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Trim())), RegexOptions.IgnoreCase);
Expand Down
1 change: 1 addition & 0 deletions ANAConversationStudio/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ public ObservableCollection<ChatFlowSearchItem> SearchResults

public void SearchInNodes(string keywords)
{
if (string.IsNullOrWhiteSpace(keywords)) return;
SearchResults = new ObservableCollection<ChatFlowSearchItem>(Network.Nodes.Select(node => node.ChatNode.SearchNode(keywords)).Where(x => x != null));
if (SearchResults.Count == 0)
SearchResults = new ObservableCollection<ChatFlowSearchItem>
Expand Down

0 comments on commit 026aa60

Please sign in to comment.