private bool RepositoryFilter(TankVM tank)
        {
            if (this.SelectedRepositoryFilter != s_allRepositoriesVm)
            {
                if (tank.Repository.Model != this.SelectedRepositoryFilter.Model)
                {
                    return(false);
                }
            }

            return(true);
        }
        private bool XPathFilter(TankVM tank)
        {
            if (!this.RepositoryFilter(tank))
            {
                return(false);
            }

            if (_xpathQueryResult == null)
            {
                return(true);
            }

            var queryResultTanks = _xpathQueryResult[tank.Repository.Model];

            return(queryResultTanks.Contains(tank.Model));
        }
        private bool KeywordFilter(TankVM tank)
        {
            if (!this.RepositoryFilter(tank))
            {
                return(false);
            }

            if (this.SelectedClassFilter != s_allClassesVm)
            {
                if (tank.Model.ClassKey != this.SelectedClassFilter.Model)
                {
                    return(false);
                }
            }

            if (this.SelectedNationFilter != s_allNationsVm)
            {
                if (tank.Model.NationKey != this.SelectedNationFilter.Model)
                {
                    return(false);
                }
            }

            if (this.SelectedTierFilter != s_allTiersVm)
            {
                if (tank.Model.Tier != this.SelectedTierFilter.Model)
                {
                    return(false);
                }
            }

            if (this.SelectedPremiumFilter != s_bothPremiumVm)
            {
                if (tank.Model.IsPremium != (this.SelectedPremiumFilter.Model == PremiumState.Premium))
                {
                    return(false);
                }
            }

            if (string.IsNullOrWhiteSpace(this.FilterText))
            {
                return(true);
            }

            return(tank.Name.ToLowerInvariant().Contains(this.FilterText.ToLowerInvariant()) ||
                   tank.ShortName.ToLowerInvariant().Contains(this.FilterText.ToLowerInvariant()));
        }