Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- DispatcherProcessingDisabled.cs
- SafeBitVector32.cs
- BindingList.cs
- ViewKeyConstraint.cs
- RedirectionProxy.cs
- SingleConverter.cs
- Gdiplus.cs
- Material.cs
- WebPartConnectionsCloseVerb.cs
- TdsParserSafeHandles.cs
- AxisAngleRotation3D.cs
- FixedDocumentPaginator.cs
- TypefaceCollection.cs
- SchemaCollectionCompiler.cs
- TextEditorDragDrop.cs
- StreamInfo.cs
- XpsException.cs
- MembershipSection.cs
- DesignSurfaceEvent.cs
- HttpClientCertificate.cs
- XmlReturnReader.cs
- XmlObjectSerializerWriteContext.cs
- XmlResolver.cs
- SmtpDigestAuthenticationModule.cs
- LinqDataSourceValidationException.cs
- InputMethodStateChangeEventArgs.cs
- ObjectDataSourceFilteringEventArgs.cs
- WindowsMenu.cs
- externdll.cs
- ViewBox.cs
- CurrencyManager.cs
- StrokeNodeEnumerator.cs
- SymbolEqualComparer.cs
- ListViewItem.cs
- Inline.cs
- UserControlBuildProvider.cs
- ObjectItemCollection.cs
- XPathNavigatorReader.cs
- BindingRestrictions.cs
- RectKeyFrameCollection.cs
- DataGridViewUtilities.cs
- ServiceErrorHandler.cs
- BreakRecordTable.cs
- DiscoveryServerProtocol.cs
- WebPartConnectVerb.cs
- AbandonedMutexException.cs
- Effect.cs
- SqlConnectionStringBuilder.cs
- DoubleAnimationUsingKeyFrames.cs
- StringToken.cs
- XmlValidatingReader.cs
- UInt32.cs
- CornerRadius.cs
- MethodCallConverter.cs
- DropShadowBitmapEffect.cs
- MediaElementAutomationPeer.cs
- ServiceMetadataPublishingElement.cs
- PhysicalFontFamily.cs
- WindowsUpDown.cs
- XAMLParseException.cs
- PTConverter.cs
- WindowsToolbarAsMenu.cs
- ObjectItemAssemblyLoader.cs
- WebHttpSecurityElement.cs
- ProcessModuleCollection.cs
- CreateSequence.cs
- CodeNamespaceImportCollection.cs
- GetImportFileNameRequest.cs
- RIPEMD160.cs
- Compensate.cs
- DoubleLinkListEnumerator.cs
- Accessors.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DataGridViewButtonCell.cs
- HttpFileCollection.cs
- RelationshipFixer.cs
- ExpressionBuilderContext.cs
- Window.cs
- PopupControlService.cs
- UserValidatedEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- DataControlLinkButton.cs
- WsatRegistrationHeader.cs
- BuildProvidersCompiler.cs
- HierarchicalDataBoundControlAdapter.cs
- StylusPointPropertyInfoDefaults.cs
- CommandPlan.cs
- SmiEventSink.cs
- TemplatingOptionsDialog.cs
- InfoCardTraceRecord.cs
- InputLangChangeRequestEvent.cs
- ShaderEffect.cs
- DesignerDataRelationship.cs
- InternalConfigEventArgs.cs
- Permission.cs
- MailDefinitionBodyFileNameEditor.cs
- SelectionListDesigner.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XDeferredAxisSource.cs
- ExpressionBuilderCollection.cs