コード例 #1
0
 public void FindWordsByAlphabet(char letter)
 {
     if (_isthreecc == 1)
     {
         ObservableCollection <Word> list = (Application.Current as App).ThreeCCDB.SelectObservableCollection <Word>(string.Format("select Name,Description_EN,Description_CN,Detail_EN,Detail_CN from ThreeCharClassic where Name like '{0}%' ", letter));
         if (list == null || list.Count == 0)
         {
             WordsByAlphabetFound(null);
         }
         else
         {
             WordsByAlphabetFound(list);
         }
     }
     else
     {
         ObservableCollection <Word> list = (Application.Current as App).GlossaryDB.SelectObservableCollection <Word>(string.Format("select Name from SAPDictionary where Name like '{0}%' and Language='{1}' ", letter, _lang));
         if (list == null || list.Count == 0)
         {
             if (!EnableRemote)
             {
                 if (WordsByAlphabetFound != null)
                 {
                     WordsByAlphabetFound(null);
                 }
             }
             else
             {
                 SAPDictionaryService.SAPDictionarySoapClient client = new SAPDictionaryService.SAPDictionarySoapClient();
                 client.FindWordsByAlphabetAsync(letter, _lang);
                 client.FindWordsByAlphabetCompleted += new EventHandler <SAPDictionaryService.FindWordsByAlphabetCompletedEventArgs>(client_FindWordsByAlphabetCompleted);
             }
         }
         else
         {
             if (WordsByAlphabetFound != null)
             {
                 WordsByAlphabetFound(list);
             }
         }
     }
 }