コード例 #1
0
        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));
        }
コード例 #2
0
 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));
 }
コード例 #3
0
 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));
 }