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
- ObjectKeyFrameCollection.cs
- IPEndPoint.cs
- StringAnimationBase.cs
- MethodRental.cs
- XhtmlTextWriter.cs
- followingsibling.cs
- DocumentSequence.cs
- TdsParserSafeHandles.cs
- PerspectiveCamera.cs
- BindingExpressionUncommonField.cs
- XsdValidatingReader.cs
- UpdateDelegates.Generated.cs
- MetadataSerializer.cs
- DocumentPageTextView.cs
- XmlSchemaCollection.cs
- TypeForwardedToAttribute.cs
- TreeIterator.cs
- PropertyEntry.cs
- NamedPipeWorkerProcess.cs
- XsdDateTime.cs
- COM2ColorConverter.cs
- WebUtil.cs
- TransferMode.cs
- MasterPageBuildProvider.cs
- WebServiceClientProxyGenerator.cs
- TraceUtils.cs
- HMACRIPEMD160.cs
- AccessControlList.cs
- QueryExtender.cs
- DbSourceCommand.cs
- FileEnumerator.cs
- ConnectionPoint.cs
- ResXFileRef.cs
- TypeUtil.cs
- ResourceSetExpression.cs
- ToggleButtonAutomationPeer.cs
- PropertyEmitterBase.cs
- _AutoWebProxyScriptEngine.cs
- IgnoreSection.cs
- CodeExpressionRuleDeclaration.cs
- RijndaelManagedTransform.cs
- StringAttributeCollection.cs
- EntityContainerEntitySetDefiningQuery.cs
- BooleanExpr.cs
- SqlReferenceCollection.cs
- Script.cs
- Matrix.cs
- COM2ComponentEditor.cs
- hresults.cs
- ZipIOExtraFieldZip64Element.cs
- ObjectPersistData.cs
- Rect3DConverter.cs
- UserControlBuildProvider.cs
- OracleCommandSet.cs
- _ScatterGatherBuffers.cs
- SizeLimitedCache.cs
- WindowsRichEdit.cs
- ItemsChangedEventArgs.cs
- PartManifestEntry.cs
- InvalidCommandTreeException.cs
- Expressions.cs
- ResourceDictionary.cs
- ProfileModule.cs
- TcpStreams.cs
- CustomWebEventKey.cs
- ChtmlCalendarAdapter.cs
- ProxyElement.cs
- regiisutil.cs
- Rotation3DKeyFrameCollection.cs
- CodeComment.cs
- RuntimeCompatibilityAttribute.cs
- RSACryptoServiceProvider.cs
- TextDecoration.cs
- ToolStripOverflow.cs
- ColumnCollection.cs
- HitTestDrawingContextWalker.cs
- XmlObjectSerializerContext.cs
- PerformanceCounterLib.cs
- HtmlInputButton.cs
- ExpanderAutomationPeer.cs
- SingleTagSectionHandler.cs
- MaskDescriptors.cs
- CatalogZoneBase.cs
- JobInputBins.cs
- TrackingStringDictionary.cs
- DeploymentSection.cs
- TileBrush.cs
- DesignerCategoryAttribute.cs
- PropertyGridEditorPart.cs
- Set.cs
- IDQuery.cs
- FixedPageProcessor.cs
- SingleConverter.cs
- WebEvents.cs
- ZoneMembershipCondition.cs
- UiaCoreTypesApi.cs
- ActionFrame.cs
- InstanceContext.cs
- DataListItemCollection.cs
- Matrix3D.cs