//-------------------------------------------------------------------------------------- // File: DXMUTException.cs // // Holds all exception classes for the DX Managed Utility Toolkit // // Copyright (c) Microsoft Corporation. All rights reserved. //-------------------------------------------------------------------------------------- using System; using System.Collections; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; namespace Microsoft.Samples.DirectX.UtilityToolkit { /// Base class for sample exceptions public class DirectXSampleException : System.ApplicationException { public DirectXSampleException(string message) : base(message) {} public DirectXSampleException(string message, Exception inner) : base(message, inner) {} } /// /// The No Direct3D exception. Something really had to go wrong for this to occur. /// public class NoDirect3DException : DirectXSampleException { public NoDirect3DException() : base("Could not initialize Direct3D. You may want to check that the latest version of DirectX is correctly installed on your system.") {} public NoDirect3DException(Exception inner) : base("Could not initialize Direct3D. You may want to check that the latest version of DirectX is correctly installed on your system.", inner) {} } /// /// No compatible devices were found for this application. /// public class NoCompatibleDevicesException : DirectXSampleException { public NoCompatibleDevicesException() : base("Could not find any compatible Direct3D devices.") { } public NoCompatibleDevicesException(Exception inner) : base("Could not find any compatible Direct3D devices.", inner) {} } /// /// Media couldn't be found /// public class MediaNotFoundException : DirectXSampleException { public MediaNotFoundException() : base("Could not find required media. Ensure that the DirectX SDK is correctly installed.") { } public MediaNotFoundException(Exception inner) : base("Could not find required media. Ensure that the DirectX SDK is correctly installed.", inner) {} } /// /// Creating the device failed /// public class CreatingDeviceException : DirectXSampleException { public CreatingDeviceException() : base("Failed creating the Direct3D device.") { } public CreatingDeviceException(Exception inner) : base("Failed creating the Direct3D device.", inner) {} } /// /// Resetting the device failed /// public class ResettingDeviceException : DirectXSampleException { public ResettingDeviceException() : base("Failed resetting the Direct3D device.") { } public ResettingDeviceException(Exception inner) : base("Failed resetting the Direct3D device.", inner) {} } /// /// Creating the device objects failed /// public class CreatingDeviceObjectsException : DirectXSampleException { public CreatingDeviceObjectsException() : base("Failed creating Direct3D device objects.") { } public CreatingDeviceObjectsException(Exception inner) : base("Failed creating Direct3D device objects.", inner) {} } /// /// Resetting the device failed /// public class ResettingDeviceObjectsException : DirectXSampleException { public ResettingDeviceObjectsException() : base("Failed resetting Direct3D device objects.") { } public ResettingDeviceObjectsException(Exception inner) : base("Failed resetting Direct3D device objects.", inner) {} } }