StreetFoo.Client.SearchResultsPageViewModel.ActivateFilter C# (CSharp) Method

ActivateFilter() private method

private ActivateFilter ( string keyword ) : void
keyword string
return void
        private void ActivateFilter(string keyword)
        {
            // walk and set...
            bool found = false;
            foreach (var filter in this.Filters)
            {
                if (filter.Keyword == keyword)
                {
                    filter.Active = true;
                    found = true;
                }
                else
                    filter.Active = false;
            }

            // did we do it? if not, activate the default one...
            if (keyword != null && !(found))
                this.ActivateFilter(null);
        }