コード例 #1
0
 public void FindTheWord(string name)
 {
     if (_isthreecc == 1)
     {
         List <Word> list = (Application.Current as App).ThreeCCDB.SelectList <Word>(string.Format("select Name,Description_EN,Description_CN,Detail_EN,Detail_CN from ThreeCharClassic where Name='{0}' ", name.ToUpper()));
         if (list == null || list.Count == 0)
         {
             _theword = null;
         }
         else
         {
             _theword = list[0];
         }
     }
     else
     {
         List <Word> list = (Application.Current as App).GlossaryDB.SelectList <Word>(string.Format("select Name, Domain, Description from SAPDictionary where Name like '{0}' and Language='{1}' ", name, _lang));
         if (list == null || list.Count == 0)
         {
             if (!EnableRemote)
             {
                 _theword = null;
             }
             else
             {
                 SAPDictionaryService.SAPDictionarySoapClient client = new SAPDictionaryService.SAPDictionarySoapClient();
                 client.FindTheWordAsync(name, _lang);
                 client.FindTheWordCompleted += new EventHandler <SAPDictionaryService.FindTheWordCompletedEventArgs>(client_FindTheWordCompleted);
             }
         }
         else
         {
             _theword = list[0];
         }
     }
     if (TheWordFound != null)
     {
         TheWordFound(_theword);
     }
 }