Esempio n. 1
0
        public async Task <IEnumerable <Models.Suggestion> > RetrieveSuggestionsAsync(string word, Models.Dictionary dictionary)
        {
            _host.CallFunction("retrieveSuggestions", word, dictionary.Value);

            while (!SuggestionsResponse.Done)
            {
                await Task.Delay(100);
            }

            SuggestionsResponse.Done = false;
            return(SuggestionsResponse.Object.Take(15));
        }
Esempio n. 2
0
        private void PeopleCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (e.OldItems != null && e.OldItems.Count > 0)
            {
                foreach (People people in e.OldItems)
                {
                    host.CallFunction("deleteFunction", people.Id);
                }
            }

            if (e.NewItems != null && e.NewItems.Count > 0)
            {
            }
        }
Esempio n. 3
0
 //调用函数
 public string callJs(string fun, params object[] args)
 {
     try
     {
         return(engine.CallFunction(fun, args.ToArray()).ToString());
     }
     catch (Exception ex) {
         Util.log(source, "JsEngine.callJs:" + fun, ex.Message, ex);
         return(null);
     }
 }