public ITerminationHandle SetSearchData(ISelectionPosition selectionPosition, IConsumer <AssetData> consumer, string search) { _filter = search.Trim(); if (_filter.Length == 0) { _results.Clear(); return(null); } var matcher = SoftStringMatcher.New(_filter); _results.SetMatcher(matcher); return(new SearchProcess <AssetData>(_results, selectionPosition, consumer)); }
ITerminationHandle ISearchLens <GameObject> .SetSearchData(ISelectionPosition selectionPosition, IConsumer <GameObject> consumer, string search) { if (_searchString == null) { _objects = new CachedEnumerable <GameObject>(SceneWalker.SceneObjectsDFS(ShouldExploreObject)); } _searchString = search; if (search.Length > 0) { var matcher = SoftStringMatcher.New(search); consumer.Consume(_objects.Where(g => matcher.IsMatch(g.name))); } return(null); }
public void ApplyData(string searchTerm, AssetDataDisplay element, IReadOnlyList <AssetData> data, int idx) { var matcher = SoftStringMatcher.New(searchTerm); element.Apply(matcher, data[idx]); }