public int InstancesOfWordInSentence()
        {
            string[] words       = Sentence.Split(new char[] { '.', '?', '!', ' ', ';', ':', ',' }, StringSplitOptions.RemoveEmptyEntries);
            var      wordMatches = from word in words
                                   where word.ToLower() == SearchWord.ToLower()
                                   select word;

            return(wordMatches.Count());
        }
Exemplo n.º 2
0
        private void UpdateListeEvent()
        {
            if (SearchWord == "" || SearchWord == null)
            {
                ListeEventToShow = ListToObservableCollectionFactory.Convert(ListeEvent); return;
            }
            ObservableCollection <Evenement> tmp = new ObservableCollection <Evenement>();
            Regex r = new Regex("^.*" + SearchWord.ToLower() + ".*$");

            for (int i = 0; i < ListeEvent.Count(); i++)
            {
                if (r.IsMatch(ListeEvent[i].Nom.ToLower()))
                {
                    tmp.Add(ListeEvent[i]);
                }
            }
            ListeEventToShow = tmp;
            NotifyPropertyChanged("ListeEventToShow");
        }
Exemplo n.º 3
0
 private void Display(DirectoryInfo path)
 {
     try
     {
         foreach (DirectoryInfo dir in path.GetDirectories())
         {
             if (dir.Name.ToLower().Contains(SearchWord.ToLower()))
             {
                 matches.Add(dir);
             }
             Display(dir);
         }
         foreach (FileInfo file in path.GetFiles())
         {
             if (file.Name.ToLower().Contains(SearchWord.ToLower()))
             {
                 matches.Add(file);
             }
         }
     }
     catch (Exception e1) {  }
 }
Exemplo n.º 4
0
 private void Search()
 {
     Establishments = _allEstablishments.Where(a => a.Name.ToLower().Contains(SearchWord.ToLower())).ToList();
 }
Exemplo n.º 5
0
 private void Search()
 {
     //TODO - Lógica de filtrar a lista de lojas
     Establishments = _allEstablishment.Where(a => a.Name.ToLower().Contains(SearchWord.ToLower())).ToList();
 }