Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / System / ComponentModel / InvalidEnumArgumentException.cs / 1 / InvalidEnumArgumentException.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.ComponentModel {
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;
using System.Security.Permissions;
///
/// The exception that is thrown when using invalid arguments that are enumerators.
///
[HostProtection(SharedState = true)]
[Serializable]
public class InvalidEnumArgumentException : ArgumentException {
///
/// Initializes a new instance of the class without a message.
///
public InvalidEnumArgumentException() : this(null) {
}
///
/// Initializes a new instance of the class with
/// the specified message.
///
public InvalidEnumArgumentException(string message)
: base(message) {
}
///
/// Initializes a new instance of the Exception class with a specified error message and a
/// reference to the inner exception that is the cause of this exception.
/// FxCop CA1032: Multiple constructors are required to correctly implement a custom exception.
///
public InvalidEnumArgumentException( string message, Exception innerException )
: base(message, innerException) {
}
///
/// Initializes a new instance of the class with a
/// message generated from the argument, invalid value, and enumeration
/// class.
///
public InvalidEnumArgumentException(string argumentName, int invalidValue, Type enumClass)
: base(SR.GetString(SR.InvalidEnumArgument,
argumentName,
invalidValue.ToString(CultureInfo.CurrentCulture),
enumClass.Name), argumentName) {
}
///
/// Need this constructor since Exception implements ISerializable. We don't have any fields,
/// so just forward this to base.
///
protected InvalidEnumArgumentException(SerializationInfo info, StreamingContext context) : base(info, context) {
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlBoundElement.cs
- DateTimeFormat.cs
- CompatibleComparer.cs
- MapPathBasedVirtualPathProvider.cs
- Point.cs
- M3DUtil.cs
- SessionEndedEventArgs.cs
- WindowsTokenRoleProvider.cs
- PersonalizableAttribute.cs
- ValidationRuleCollection.cs
- GC.cs
- CollectionType.cs
- SoapSchemaExporter.cs
- ActivationArguments.cs
- AuthenticationModuleElement.cs
- ListViewDeleteEventArgs.cs
- SizeIndependentAnimationStorage.cs
- WebPartDescription.cs
- BinaryMethodMessage.cs
- SiteMapHierarchicalDataSourceView.cs
- Int64Storage.cs
- ProcessModuleCollection.cs
- CustomAttributeFormatException.cs
- ObjectCloneHelper.cs
- COMException.cs
- ScrollItemPatternIdentifiers.cs
- PreloadedPackages.cs
- ClaimSet.cs
- ScopelessEnumAttribute.cs
- AssociationSetMetadata.cs
- WebException.cs
- CompareValidator.cs
- DesignerDataRelationship.cs
- InkCanvas.cs
- Win32SafeHandles.cs
- PropertyChange.cs
- PropertyToken.cs
- TextElementAutomationPeer.cs
- __ConsoleStream.cs
- DNS.cs
- XmlCustomFormatter.cs
- CollectionConverter.cs
- IImplicitResourceProvider.cs
- ToolStripSystemRenderer.cs
- DPTypeDescriptorContext.cs
- GridViewCommandEventArgs.cs
- HostSecurityManager.cs
- BuildProvidersCompiler.cs
- CacheMemory.cs
- PlanCompiler.cs
- AttributeXamlType.cs
- LambdaExpression.cs
- SequenceDesigner.cs
- RuleInfoComparer.cs
- RequestQueryProcessor.cs
- UriSection.cs
- Trustee.cs
- DoubleAnimationUsingKeyFrames.cs
- SoapExtensionTypeElementCollection.cs
- CorrelationActionMessageFilter.cs
- SectionVisual.cs
- ICspAsymmetricAlgorithm.cs
- WindowsHyperlink.cs
- ThousandthOfEmRealPoints.cs
- CSharpCodeProvider.cs
- SafeBitVector32.cs
- GetReadStreamResult.cs
- PartBasedPackageProperties.cs
- ButtonAutomationPeer.cs
- MergablePropertyAttribute.cs
- EventProviderWriter.cs
- X509CertificateCollection.cs
- XmlSchemaAttributeGroupRef.cs
- EventDescriptor.cs
- TextServicesProperty.cs
- NumberFunctions.cs
- ListItemParagraph.cs
- MemoryMappedView.cs
- shaperfactory.cs
- UTF8Encoding.cs
- MembershipUser.cs
- IteratorDescriptor.cs
- IndexingContentUnit.cs
- EventLog.cs
- CookielessData.cs
- ClientConfigurationHost.cs
- SoapMessage.cs
- MultiByteCodec.cs
- SafeNativeMethods.cs
- QueueSurrogate.cs
- TabPanel.cs
- ClientUtils.cs
- ClientSettingsProvider.cs
- ObjectTypeMapping.cs
- XhtmlBasicSelectionListAdapter.cs
- SortedList.cs
- UIElementCollection.cs
- SqlClientWrapperSmiStream.cs
- XmlDomTextWriter.cs
- TextFormatterContext.cs