public SearchResultItemViewModel(CommandBindingCollection commandBindings, ITankInfo tankInfo, HangarViewModel owner) { _commandBindings = commandBindings; this.Tank = tankInfo; this.Owner = owner; this.SelectTankCommand = new RelayCommand(() => owner.SelectSearchResultTank(this.Tank)); this.SelectAsReferenceTankCommand = new RelayCommand(() => owner.SelectSearchResultTankAsReferenceTank(this.Tank)); }
private bool MatchKeyword(ITankInfo tank, string keyword) { return(this.MatchKeyword(tank.Name, keyword) || this.MatchKeyword(tank.ShortName, keyword) || this.MatchKeyword(Database.GetPinyinString(tank.Name), keyword)); }
private bool MatchTank(ITankInfo tank, string keyword, int tier = -1, TankClass tankClass = TankClass.Mixed) { return(this.MatchTier(tank.Tier, tier) && this.MatchClass(tank.Class, tankClass) && this.MatchKeyword(tank, keyword)); }