Wrox Programmer Forums
|
BOOK: Beginning Windows 8 Application Development
This is the forum to discuss the Wrox book Beginning Windows 8 Application Development by Istvan Novak, Zoltan Arvai, Gyorgy Balassy, David Fulop; ISBN: 978-1-118-01268-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Windows 8 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2013, 10:25 PM
Registered User
 
Join Date: Apr 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5: Asynchronous Development Platform

I'm working through this book, doing the exercises in VB instead of C#.

I'm in Chapter 5, and have reached the section called Implementing Cancellation in C# 5.0.

I'm finding it difficult, since it is talking about creating a CancellationTokenSource object, and then passing its token to the await wc.DownloadStringTaskAsync method. (wc is a WebClient object).

When trying to write the code (in VB), the DownloadStringTaskAsync method doesn't accept a second parameter at all.

I was able to get cancellation working by simply calling the wc.CancelAsync method from inside btn_Cancel_Click.

However, the next step on (page 149, step 8) is then to implement a timeout. It appears that now I really do need to use a CancellationTokenSource object, but I have no idea how to do this, given that I can't associate it with my DownloadStringTaskAsync (or at least not the way the book says to do it)?

Any help would be welcome! Even better if from a VB perspective, rather than C#!





Similar Threads
Thread Thread Starter Forum Replies Last Post
DevSquare an online development platform vinoopsin1 Java Basics 2 May 2nd, 2014 06:59 AM
Beginning IOS 4 Development Chapter 2 webslinger2011 BOOK: Beginning iOS 4 Application Development 1 July 21st, 2011 05:35 PM
Chapter 2 YOUR DEVELOPMENT ENVIRONMENT anandvg BOOK: Beginning SharePoint 2010 Development 1 July 15th, 2011 11:09 PM
Cross platform Book xml example from Chapter 6 tomsc BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 June 25th, 2008 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.