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
- WindowsScroll.cs
- Light.cs
- MarshalByValueComponent.cs
- BufferModesCollection.cs
- PropertyDescriptorComparer.cs
- SQLCharsStorage.cs
- TagPrefixCollection.cs
- SequentialOutput.cs
- ProtectedConfiguration.cs
- TerminatorSinks.cs
- keycontainerpermission.cs
- PageAsyncTaskManager.cs
- ProgressBar.cs
- SqlTypeSystemProvider.cs
- Margins.cs
- RenderingBiasValidation.cs
- GroupAggregateExpr.cs
- ICspAsymmetricAlgorithm.cs
- ObjectStateEntry.cs
- SQLChars.cs
- SqlTypeSystemProvider.cs
- SiteMapHierarchicalDataSourceView.cs
- exports.cs
- TypeSystem.cs
- DefaultSerializationProviderAttribute.cs
- _UriTypeConverter.cs
- SpeechAudioFormatInfo.cs
- OptimalTextSource.cs
- MemberDescriptor.cs
- RightNameExpirationInfoPair.cs
- SendKeys.cs
- FileDetails.cs
- DynamicUpdateCommand.cs
- OleDbReferenceCollection.cs
- Transform3DCollection.cs
- DataTableNewRowEvent.cs
- ThicknessAnimationUsingKeyFrames.cs
- ConfigurationManagerInternalFactory.cs
- RadioButton.cs
- SqlDataSourceFilteringEventArgs.cs
- TreeWalker.cs
- ListViewEditEventArgs.cs
- InheritanceRules.cs
- EntityDataSourceMemberPath.cs
- WorkflowQueuingService.cs
- ToolTip.cs
- PersistenceMetadataNamespace.cs
- WindowsListViewItemCheckBox.cs
- Serializer.cs
- EmptyImpersonationContext.cs
- DiscoveryDefaults.cs
- PageFunction.cs
- ArithmeticLiteral.cs
- XmlWellformedWriter.cs
- ScaleTransform.cs
- ProcessInfo.cs
- UIElement.cs
- HostAdapter.cs
- ConfigurationStrings.cs
- IdentityNotMappedException.cs
- HttpClientCertificate.cs
- SqlDataSourceAdvancedOptionsForm.cs
- DynamicActivity.cs
- EventMappingSettings.cs
- SqlProvider.cs
- TimeSpanStorage.cs
- ProfileEventArgs.cs
- CompiledQuery.cs
- SafeRightsManagementEnvironmentHandle.cs
- ISessionStateStore.cs
- SurrogateSelector.cs
- LineSegment.cs
- WhiteSpaceTrimStringConverter.cs
- SoapReflectionImporter.cs
- compensatingcollection.cs
- COM2PictureConverter.cs
- TrackingDataItemValue.cs
- CodeDirectionExpression.cs
- WebPartRestoreVerb.cs
- HtmlShimManager.cs
- TextBlock.cs
- PermissionToken.cs
- RectAnimationBase.cs
- BulletedListEventArgs.cs
- TemplateBindingExpressionConverter.cs
- SqlRewriteScalarSubqueries.cs
- ActivationServices.cs
- QueuePropertyVariants.cs
- Point3DValueSerializer.cs
- FormsIdentity.cs
- BoundingRectTracker.cs
- EventData.cs
- ThreadAttributes.cs
- RuleSettingsCollection.cs
- SymbolMethod.cs
- TextRangeAdaptor.cs
- IxmlLineInfo.cs
- BoundsDrawingContextWalker.cs
- SiteMembershipCondition.cs
- ExplicitDiscriminatorMap.cs