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
- DateTimeConverter2.cs
- Hash.cs
- BinarySecretSecurityToken.cs
- ConditionChanges.cs
- AssemblyCollection.cs
- DataTableCollection.cs
- Scene3D.cs
- URLBuilder.cs
- CodeMemberField.cs
- WebPartDisplayModeCancelEventArgs.cs
- PackagePartCollection.cs
- PeerObject.cs
- MatrixUtil.cs
- CharacterMetricsDictionary.cs
- StringValidator.cs
- CompilerGeneratedAttribute.cs
- VoiceInfo.cs
- CursorConverter.cs
- ControlLocalizer.cs
- DrawingGroup.cs
- HttpServerVarsCollection.cs
- ActiveXHost.cs
- ExpiredSecurityTokenException.cs
- RichTextBox.cs
- ImageCollectionCodeDomSerializer.cs
- SerializationSectionGroup.cs
- MatrixAnimationUsingPath.cs
- CodePropertyReferenceExpression.cs
- MouseButtonEventArgs.cs
- ReferentialConstraint.cs
- MetaType.cs
- XmlSchemaSubstitutionGroup.cs
- OpenFileDialog.cs
- SessionEndingCancelEventArgs.cs
- BitStack.cs
- CodeChecksumPragma.cs
- QuaternionRotation3D.cs
- TypeUnloadedException.cs
- XPathNodePointer.cs
- EntityContainerEmitter.cs
- ButtonBaseAdapter.cs
- DiagnosticTrace.cs
- ConvertBinder.cs
- StickyNote.cs
- ExtendedTransformFactory.cs
- ExtendedPropertyDescriptor.cs
- SplitterPanel.cs
- MinimizableAttributeTypeConverter.cs
- ValidationEventArgs.cs
- ProfessionalColors.cs
- DeferredReference.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- safelinkcollection.cs
- QueryOperationResponseOfT.cs
- EdgeProfileValidation.cs
- CacheSection.cs
- UndoManager.cs
- Cursors.cs
- XmlSchemaProviderAttribute.cs
- ToggleButtonAutomationPeer.cs
- VScrollBar.cs
- _DisconnectOverlappedAsyncResult.cs
- XMLSyntaxException.cs
- TrueReadOnlyCollection.cs
- MeshGeometry3D.cs
- DependencyProperty.cs
- UntrustedRecipientException.cs
- UrlSyndicationContent.cs
- FixedSOMTableCell.cs
- XdrBuilder.cs
- BindingExpressionUncommonField.cs
- SqlFactory.cs
- MappingItemCollection.cs
- XmlSerializerSection.cs
- FormatterConverter.cs
- BrowserDefinitionCollection.cs
- DrawingCollection.cs
- EmissiveMaterial.cs
- ImageBrush.cs
- DllHostInitializer.cs
- CoreSwitches.cs
- SequentialOutput.cs
- TextEndOfSegment.cs
- ExpressionBuilder.cs
- WasAdminWrapper.cs
- Table.cs
- Dump.cs
- DesignColumnCollection.cs
- Vector3DCollectionConverter.cs
- TextEditor.cs
- BlurBitmapEffect.cs
- RulePatternOps.cs
- OleDbDataAdapter.cs
- JournalEntryStack.cs
- StyleBamlTreeBuilder.cs
- X509WindowsSecurityToken.cs
- StringSorter.cs
- DataBindingCollection.cs
- InitializationEventAttribute.cs
- DefaultMemberAttribute.cs