コード例 #1
0
        private async Task <MopViewModel> GetMopViewModel(int id)
        {
            Mop parsed = await ApiManager.GetMopAsync(id);

            MopViewModel mopView = new MopViewModel(parsed);

            return(mopView);
        }
コード例 #2
0
 private bool FilterCondition(MopViewModel mop, string[] filters)
 {
     foreach (string filter in filters)
     {
         if (!mop.Facilities[filter])
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #3
0
 private bool SearchCondition(MopViewModel mop, string searchPhrase)
 {
     if (searchPhrase == null)
     {
         return(true);
     }
     foreach (string word in searchPhrase.Split())
     {
         if (!SearchConditionWord(mop, word))
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #4
0
 private bool SearchConditionWord(MopViewModel mop, string searchPhrase)
 {
     return((mop.Title.ToLower().Contains(searchPhrase)) || (mop.RoadNumber.ToLower().Contains(searchPhrase)) ||
            (mop.Direction.ToLower().Contains(searchPhrase)) || (mop.Town.ToLower().Contains(searchPhrase)));
 }