init
This commit is contained in:
86
Common/DTS.Common.Utilities/ExceptionalForm.cs
Normal file
86
Common/DTS.Common.Utilities/ExceptionalForm.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* ExceptionalForm.cs
|
||||
*
|
||||
* Copyright © 2009
|
||||
* Diversified Technical Systems, Inc.
|
||||
* All Rights Reserved
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DTS.Common.Utilities
|
||||
{
|
||||
/// <summary>
|
||||
/// A Windows-style Form with it's own exception type.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// Sample usage:
|
||||
/// public class A : ExceptionalForm
|
||||
/// {
|
||||
/// public void ScrewItUp( )
|
||||
/// {
|
||||
/// private bool error = true;
|
||||
/// if ( error ) throw new A.Exception( "Class A-specific screwup." );
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// ...
|
||||
///
|
||||
/// try
|
||||
/// {
|
||||
/// A.ScrewItUp( );
|
||||
/// B.ScrewItUp( );
|
||||
/// C.ScrewItUp( );
|
||||
/// }
|
||||
/// catch ( A.Exception ex )
|
||||
/// {
|
||||
/// // Can pick A's exceptions out of a crowd, or not and just treat it
|
||||
/// // polymorphically as a System.Exception.
|
||||
/// }
|
||||
/// </remarks>
|
||||
///
|
||||
[global::System.Serializable]
|
||||
public class ExceptionalForm : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// Initialize an instance of the ExceptionForm class.
|
||||
/// </summary>
|
||||
public ExceptionalForm()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A representation of the DerivedClass.Exception class.
|
||||
/// </summary>
|
||||
public class Exception : ApplicationException
|
||||
{
|
||||
/// <summary>
|
||||
/// create a <see cref="ExceptionalForm.Exception" />
|
||||
/// </summary>
|
||||
public Exception() { }
|
||||
/// <summary>
|
||||
/// create a <see cref="ExceptionalForm.Exception" /> with
|
||||
/// a description
|
||||
/// </summary>
|
||||
/// <param name="msg">Description of error</param>
|
||||
public Exception(string msg) : base(msg) { }
|
||||
/// <summary>
|
||||
/// create a <see cref="ExceptionalForm.Exception" /> with
|
||||
/// a description and a reference to the exception causing the error
|
||||
/// </summary>
|
||||
/// <param name="msg">Description of error</param>
|
||||
/// <param name="innerEx">exception causing the error</param>
|
||||
public Exception(string msg, System.Exception innerEx) : base(msg, innerEx) { }
|
||||
protected Exception(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user