1
0

Program.cs 767 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Reactive.Linq;
  3. using System.Windows.Forms;
  4. using System.Reactive.Disposables;
  5. using Excercise7.DictionarySuggestService;
  6. namespace Excercise7
  7. {
  8. class Program
  9. {
  10. static void Main()
  11. {
  12. var svc = new DictServiceSoapClient("DictServiceSoap");
  13. var matchInDict = Observable.FromAsyncPattern<string, string, string, DictionaryWord[]>
  14. (svc.BeginMatchInDict, svc.EndMatchInDict);
  15. var res = matchInDict("wn", "react", "prefix");
  16. var subscription = res.Subscribe(words =>
  17. {
  18. foreach (var word in words)
  19. Console.WriteLine(word.Word);
  20. });
  21. Console.ReadLine();
  22. }
  23. }
  24. }