Example #1
0
        private void OnSearchFieldChanged(ChangeEvent <string> changeEvent)
        {
            var searchValue = changeEvent.newValue.Trim();

            entities.ApplySearch(EntitySearchParameters.FromSearchString(searchValue));
            listView.Refresh();
        }
Example #2
0
        public bool Matches(EntitySearchParameters searchParameters)
        {
            if (searchParameters.EntityId.HasValue)
            {
                return(searchParameters.EntityId.Value == EntityId);
            }

            if (!string.IsNullOrEmpty(searchParameters.SearchFragment))
            {
                return(Metadata.ToLower().Contains(searchParameters.SearchFragment));
            }

            return(true);
        }
Example #3
0
        public void ApplySearch(EntitySearchParameters searchParameters)
        {
            this.searchParameters = searchParameters;

            using (applySearchMarker.Auto())
            {
                FilteredData.Clear();

                foreach (var datum in fullData)
                {
                    if (datum.Matches(searchParameters))
                    {
                        FilteredData.Add(datum);
                    }
                }
            }
        }