Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 4.5 and Visual Studio 2012 > BOOK: Beginning Windows 8 Application Development
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 8th, 2013, 10:25 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
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#!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:43 AM.

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