Debian Codegraph @

external/rx/Rx/NET/Samples/HOL/CS/Excercise7/Step04/Program.cs

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