Example #1
0
        async void Init()
        {
            IsLoading = System.Windows.Visibility.Visible;
            //var temp = _DB.Contacts;
            var soapClient = new ContactsSoap.ContactsSoapClient();

            /*var client = new HttpClient {
             *  BaseAddress = new Uri("http://localhost:49839/api/"),
             *  DefaultRequestHeaders= {{"accept","application/xml"}}
             * };
             * var temp = await client.GetAsync("Contacts");
             * //var contacts = await Task.Run(() => temp.ToList());*/
            IEnumerable <Contact> temp = await soapClient.GetContactsAsync(0);

            //Log = await temp.Content.ReadAsStringAsync();
            IEnumerable <Contact> contacts = temp;

            foreach (var item in contacts)
            {
                Contacts.Add(item);
            }

            Log = await soapClient.DoWorkAsync();

            IsLoading = System.Windows.Visibility.Hidden;
        }
Example #2
0
        async void Init()
        {
            var soapClient = new ContactsSoap.ContactsSoapClient();
            IEnumerable <Contact> contacts = await soapClient.GetContactsAsync(0);;

            foreach (var item in contacts)
            {
                Contacts.Add(item);
            }
        }
Example #3
0
        async void Init()
        {
            IsLoading = System.Windows.Visibility.Visible;
            //var temp = _DB.Contacts;
            var soapClient = new ContactsSoap.ContactsSoapClient();

            Log = await soapClient.DoWorkAsync();

            IEnumerable <Contact> contacts;
            int i = 0;

            do
            {
                contacts = await soapClient.GetContactsAsync(i ++);

                foreach (var item in contacts)
                {
                    Contacts.Add(item);
                }
            } while (contacts.Any());

            IsLoading = System.Windows.Visibility.Hidden;
        }