O'Reilly logo

Mastering LOB Development for Silverlight 5: A Case Study in Action by Rocío Serrano, Braulio Díez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exception handling

Many software development communities have a very large thread in the forum about coding styles horror. Most of the posted code snippets are about exception handling, which shows how difficult this topic is. Therefore, we must talk about exception handling first, along with what to do and what not to do.

Getting started

This part gives you an initial introduction to exception handling in Silverlight and a warm up for all developers who are familiar with this topic.

Try and catch

Let's have a look at the syntax of the easiest expression in exception handling:

try
{
// Statement
}
catch (FileNotFoundException e)
{
// Statement
}
catch (IOException)
{
// Statement
}
catch
{
// Statement
}

The try block contains the statements that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required