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
- PublisherIdentityPermission.cs
- OleDbConnection.cs
- ParserStreamGeometryContext.cs
- SmiXetterAccessMap.cs
- InheritanceAttribute.cs
- TempFiles.cs
- ViewStateModeByIdAttribute.cs
- MachineKey.cs
- CurrentChangingEventArgs.cs
- LogEntryUtils.cs
- KeyFrames.cs
- ColorPalette.cs
- XamlGridLengthSerializer.cs
- TypeDelegator.cs
- ProcessModelSection.cs
- EventDescriptor.cs
- GlobalizationSection.cs
- MsmqDecodeHelper.cs
- SeverityFilter.cs
- DiscoveryMessageSequence11.cs
- EventKeyword.cs
- MessageFormatterConverter.cs
- TableCellAutomationPeer.cs
- SecurityContextTokenValidationException.cs
- IgnoreSectionHandler.cs
- ObjectDataSource.cs
- CallbackValidatorAttribute.cs
- NameValueConfigurationCollection.cs
- ArithmeticException.cs
- OleDbParameterCollection.cs
- SqlRowUpdatedEvent.cs
- ControlEvent.cs
- TypographyProperties.cs
- DeferredTextReference.cs
- PrintDialog.cs
- IdentityModelStringsVersion1.cs
- DrawingAttributesDefaultValueFactory.cs
- JsonQNameDataContract.cs
- XmlMapping.cs
- WebSysDefaultValueAttribute.cs
- DelimitedListTraceListener.cs
- DeferredSelectedIndexReference.cs
- WindowsAuthenticationEventArgs.cs
- MenuItem.cs
- EUCJPEncoding.cs
- XsdSchemaFileEditor.cs
- UniqueEventHelper.cs
- RectConverter.cs
- SafeFileMappingHandle.cs
- ReferencedType.cs
- DesignerWithHeader.cs
- FontWeights.cs
- EventRecord.cs
- _Rfc2616CacheValidators.cs
- contentDescriptor.cs
- ConfigurationLocation.cs
- Point.cs
- PrintSystemException.cs
- _Connection.cs
- ParentControlDesigner.cs
- ValidationSummary.cs
- NameService.cs
- WeakKeyDictionary.cs
- XmlWriterTraceListener.cs
- DecoderFallback.cs
- SafeLocalAllocation.cs
- EnumerableRowCollectionExtensions.cs
- RoamingStoreFile.cs
- ZeroOpNode.cs
- AdRotatorDesigner.cs
- XmlSequenceWriter.cs
- ACE.cs
- LogicalChannelCollection.cs
- AspNetHostingPermission.cs
- EmptyQuery.cs
- DNS.cs
- NativeMethodsOther.cs
- RoutingTable.cs
- FragmentQuery.cs
- XmlSchemaCollection.cs
- SkinBuilder.cs
- ScrollBar.cs
- CryptoProvider.cs
- AdornerDecorator.cs
- RichTextBox.cs
- BufferedWebEventProvider.cs
- SecureUICommand.cs
- PublisherIdentityPermission.cs
- PermissionAttributes.cs
- HMACSHA256.cs
- PropertyItem.cs
- AnimationStorage.cs
- Internal.cs
- GC.cs
- PropertyInformation.cs
- TextBreakpoint.cs
- TreeNodeCollection.cs
- XamlStackWriter.cs
- MethodBody.cs
- PenThreadPool.cs