|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinAppTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void _testButton_Click( object sender, EventArgs e )
{
SubOne();
}
private void GenerateException()
{
System.Collections.Specialized.NameValueCollection nvc = null;
string foo = nvc.Count.ToString();
}
private void SubOne()
{
try
{
SubTwo();
}
catch( Exception ex )
{
throw new InvalidCastException( "SubOne call failed!", ex );
}
}
private void SubTwo()
{
try
{
GenerateException();
}
catch( Exception ex )
{
throw new DataException( "SubTwo handled an exception!", ex );
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.