Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Async II: Exception Handling

AddThis Social Bookmark Button
In the previous blog post, we looked at the basics of async. In this post, we will look at exception handling. You need exception handling the moment something goes wrong in an asynchronous call. When this happens, the Task that comes out of the asynchronous call will have an error status and you won't be able to get the result from the method.

Handling these kinds of error situations is actually really simple. The only thing you need to do is wrap your asynchronous call in a try - catch statement, just like you would do with synchronous
code. Let's take a look at an example:

public async Task PublishHikeRequest()
{
var hikeRequest = GetHikeRequest();

try
{
var client = new HttpClient();

var url = string.Format("{0}/HikeRequest", BASE_URL);
var response = await client.PostAsync(url, await BuildJsonContent(hikeRequest));
response.EnsureSuccessStatusCode();
}
catch (Exception exc)
...(Read whole news on source site)

Windows 8 App Camp Now Online - Watch to learn how to build apps

AddThis Social Bookmark Button
source: blogs.msdn The very successful Gulf Windows 8 App Camp is now available to you on our YouTube MS Gulf Community Channel!  By watching this recording you'll have the opportunity to learn how to build amazing Windows 8 apps.  Watch it again and again while you build your own app! The speaker leading this session in Dubai comes from the Microsoft Corportate office in Redmond, USA.  Michael Platt is the a Senior Director in the Developer & Platform Evangelism Group and leads the definition and provision of strategic technical evangelism support for Microsoft Corporation in Cloud Computing and Devices in
the Consumer Industry. In this role he has worked on the developer tools, languages and support of Mobile Phones, Embedded systems, Games systems, Stores and Marketplaces and most recently Tablets.  He as over 35 years experience in the industry and 18 years experience at Microsoft. ...Read more ...(Read whole news on source site)

Fast and fluid animations in your Metro style app

AddThis Social Bookmark Button
source: blogs.msdn Fast and fluid animations bring apps to life. In Windows 8 Consumer Preview, you will notice that animations are an integral part of the user experience. When you log in to your PC, the items in the Start menu animate in. When you launch an immersive app or zoom into the Start menu, the experience is enriched with a smooth animation. Animations can tell the user what happened as a result of a specific action. This visual feedback instills user confidence in the app’s responsiveness. Even a simple addition or
deletion of an item in a list can be made fluid, modern, and informative using a subtle animation. In Windows 8, animations are a key component of the Metro style personality and you can bring this personality to your own apps! Here is what’s in this blog post: A brief overview of the animation engine How to get started using the Animation Library Custom animations and how to take advantage of the animation engine improvements Tips ‘n tricks for incorporating animations in your Metro style apps. ...Read more ...(Read whole news on source site)

Easily Parallelize Operations in Flows Using the Flow Execution Engine

AddThis Social Bookmark Button
My previous article introduced the Flow Execution Engine NPantaRhei (download here from github). It showed how to define a data flow and register its operations. By default such flows are executed synchronously and sequentially – although in the background with regard to their initiator. But it´s easy to parallelize execution of operations. Here´s a first suggestion for how to run operations concurrently in the example given in the first article. The dots in the operations signify asynchronous operation: A single dot means, the operation is running on
its own single thread. Messages arriving do not hold up other operations. They are executed in the order they arrive. Two dots mean, the operation is running on multiple threads. Messages arriving do not hold up other operations. They are executed in parallel. Although execution is started in the order they arrive, the order of results might be different. No dot means, the operation is running just on the Execution Engine thread. What the design above is supposed to mean is: There are two time consuming operations, finding all relevant files and...(Read whole news on source site)

Thou shall not delete

AddThis Social Bookmark Button
Ouch!public ActionResult DeleteComment(int id) { var userComment = RavenSession.Load(id); if (userComment == null) return new HttpStatusCodeResult(204); var user = RavenSession.GetUser(User.Identity.Name); if(user == null || (user.Role != UserRole.Moderator && user.Role != UserRole.Admin)) return new HttpStatusCodeResult(403, "You must be logged in as moderator or admin to be able to delete comments"); RavenSession.Delete(user); return new HttpStatusCodeResult(204); }

HTML5 Background tasks using Web Workers

AddThis Social Bookmark Button
One of the problems with running JavaScript in the browser is that everything usually executes on the same thread as the UI. With most scripts this is fine because they are short executing however if you start doing more complex calculations you might run into the vase where the UI becomes non responsive because of the JavaScript executing. And when that happens you will see one of these dialogs popup and you are at the mercy of the end user, not the best of places to be.   Fortunately there is a fix for this
in the form of the new HTML5 Web Workers specification Web workers are relatively well supported, IE9 being the big exception, as you can see from caniuse.com. Getting started with them is quite straightforward, basically you create a Worker object and pass it the URL of the script you want to execute. This has to be a URL, you can’t just pass a function, something that would have been handy. The following HTML page contains all the code required.

Metro style applications – designing for the user

AddThis Social Bookmark Button
It has been months since Windows 8 is available for developers and the need for new applications is growing in a fast pace. And nothing is more exacting than a computer user in 21st century. It’s quite difficult to build the right application, moreover – it’s even more difficult to stay on top and not to
be, metaphorically, stepped over by the big players. They always know what exactly the user wants and have the resources to provide it to him. But that’s not always what has to happen after all.
You have the power to build what the user wants and even build it so that s/he would feel it so natural to use your Metro application. That is to design the application in a way that using the fingers on the display seems to be a pleasure, but not a challenge.
  Okay, let’s make our Metro applications look great! Designing the Metro application is different...(Read whole news on source site)

Developing Metro Apps using C++/CX, for C# developers

AddThis Social Bookmark Button
by David Britch I recently joined a project developing a Windows 8 Metro application using C++. It had been a while since I’d written any C++ and I subsequently discovered that C++ has changed. A lot. WinRT is the framework and library for building Metro applications. It can be used from C++, as well as JavaScript and .NET languages. It’s built on COM, and while working with COM has traditionally been difficult, WinRT has made the process very straight forward. Developing a Windows 8 Metro application using C++ gives you the advantages of programming in both C++11 and C++/CX. C++11, formerly known
as C++0x, is the name of the most recent iteration of the C++ programming language. It includes additions to the core language and also extends the C++ standard library. C++/CX (Component Extensions) is a set of extensions that makes it easy to consume WinRT functionality. It looks like C++/CLI but its native code, being COM under the covers rather than .NET. In addition, C++/CX hides all the COM, making programming WinRT straight forward. Example The power of WinRT and the ease of use of C++ can be demonstrated through a sample application that enumerates the Windows 8 pictures library, and displays thumbnails...(Read whole news on source site)

Home