Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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) {
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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) {
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MissingSatelliteAssemblyException.cs
- GetImportFileNameRequest.cs
- PreviewKeyDownEventArgs.cs
- CommandManager.cs
- TypeDelegator.cs
- TrackingLocationCollection.cs
- UnsafeNativeMethods.cs
- DesigntimeLicenseContextSerializer.cs
- EdmScalarPropertyAttribute.cs
- DataGridViewDataConnection.cs
- Marshal.cs
- ThousandthOfEmRealDoubles.cs
- MailAddress.cs
- GridView.cs
- PersonalizationStateInfoCollection.cs
- SQLByteStorage.cs
- Collection.cs
- XLinq.cs
- DomNameTable.cs
- EditorReuseAttribute.cs
- TypeToStringValueConverter.cs
- DefaultPropertyAttribute.cs
- ISCIIEncoding.cs
- ContainerParaClient.cs
- _ChunkParse.cs
- DesignerGeometryHelper.cs
- GraphicsContainer.cs
- Bitmap.cs
- NativeWrapper.cs
- Registration.cs
- GetBrowserTokenRequest.cs
- XamlWriterExtensions.cs
- BindUriHelper.cs
- BaseResourcesBuildProvider.cs
- XpsFilter.cs
- SerTrace.cs
- MimeMapping.cs
- ActivityBuilder.cs
- RootBrowserWindowProxy.cs
- QueryExpression.cs
- PointConverter.cs
- basenumberconverter.cs
- XmlEnumAttribute.cs
- XmlSchemaSimpleTypeList.cs
- ValueTable.cs
- DataServiceBuildProvider.cs
- Literal.cs
- EdmScalarPropertyAttribute.cs
- StyleModeStack.cs
- ProfilePropertySettings.cs
- DataServiceRequestOfT.cs
- Rectangle.cs
- WebPartEditVerb.cs
- storepermission.cs
- CompressionTransform.cs
- _KerberosClient.cs
- IndexerNameAttribute.cs
- WorkflowIdleElement.cs
- SignatureToken.cs
- UpdateCommand.cs
- SplitContainer.cs
- TraceSection.cs
- AutoGeneratedFieldProperties.cs
- Message.cs
- WebException.cs
- ListItem.cs
- Item.cs
- PreProcessor.cs
- DataGridRowEventArgs.cs
- filewebresponse.cs
- TdsValueSetter.cs
- AnimatedTypeHelpers.cs
- WindowsFormsSectionHandler.cs
- _NegotiateClient.cs
- QueryStringHandler.cs
- _ProxyRegBlob.cs
- IisTraceListener.cs
- MulticastNotSupportedException.cs
- NavigateEvent.cs
- HTTPNotFoundHandler.cs
- InstanceOwnerException.cs
- ListViewInsertionMark.cs
- Operators.cs
- PrinterResolution.cs
- CustomSignedXml.cs
- HtmlShim.cs
- DataGridTemplateColumn.cs
- WCFBuildProvider.cs
- CodeAssignStatement.cs
- AssemblyAttributesGoHere.cs
- Fx.cs
- SymLanguageVendor.cs
- SqlMethodTransformer.cs
- RenderContext.cs
- RowToFieldTransformer.cs
- TimeZone.cs
- ReferenceEqualityComparer.cs
- X509Chain.cs
- FieldNameLookup.cs
- PropertyMappingExceptionEventArgs.cs