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
- CalendarData.cs
- Baml6Assembly.cs
- MultilineStringConverter.cs
- HtmlSelect.cs
- filewebresponse.cs
- ClientScriptItemCollection.cs
- TemplateParser.cs
- ControlUtil.cs
- TimeSpanValidator.cs
- TreeNodeBindingDepthConverter.cs
- SchemaImporterExtensionsSection.cs
- LogWriteRestartAreaAsyncResult.cs
- DataContractSerializerServiceBehavior.cs
- RangeValidator.cs
- OdbcError.cs
- TextRange.cs
- FixedHyperLink.cs
- PhonemeEventArgs.cs
- TemplateEditingFrame.cs
- TypeReference.cs
- HostExecutionContextManager.cs
- CodeLabeledStatement.cs
- NumberFormatInfo.cs
- ListViewCommandEventArgs.cs
- DocumentCollection.cs
- MetadataArtifactLoaderComposite.cs
- DataGridViewImageCell.cs
- FileDialogCustomPlacesCollection.cs
- ModuleConfigurationInfo.cs
- Identity.cs
- CodeComment.cs
- AdPostCacheSubstitution.cs
- HttpCachePolicy.cs
- WorkflowServiceNamespace.cs
- ObjectSet.cs
- InstanceOwnerQueryResult.cs
- SQLDateTimeStorage.cs
- IncomingWebResponseContext.cs
- MouseEventArgs.cs
- ContextMenuStrip.cs
- RelationshipEndCollection.cs
- ExceptionUtil.cs
- ToolStripSeparatorRenderEventArgs.cs
- ResourceProperty.cs
- InputEventArgs.cs
- DependencyObjectType.cs
- HtmlImage.cs
- CheckBoxAutomationPeer.cs
- SendOperation.cs
- OdbcConnectionHandle.cs
- RelationshipNavigation.cs
- TableItemPattern.cs
- Stylus.cs
- AssemblyContextControlItem.cs
- DiagnosticEventProvider.cs
- PathSegmentCollection.cs
- SimpleModelProvider.cs
- WebBrowserEvent.cs
- InkSerializer.cs
- Label.cs
- EventItfInfo.cs
- keycontainerpermission.cs
- CharacterMetricsDictionary.cs
- SequenceRange.cs
- TransactionProxy.cs
- MailAddressCollection.cs
- TextEditorTables.cs
- MultiPropertyDescriptorGridEntry.cs
- InstanceDescriptor.cs
- HtmlInputControl.cs
- _OverlappedAsyncResult.cs
- EventMap.cs
- TableLayoutCellPaintEventArgs.cs
- WebPartsPersonalizationAuthorization.cs
- RuntimeWrappedException.cs
- LineInfo.cs
- DispatcherHookEventArgs.cs
- RegexStringValidator.cs
- CompositeCollectionView.cs
- MinMaxParagraphWidth.cs
- ReferencedCollectionType.cs
- SqlWorkflowPersistenceService.cs
- TextTrailingCharacterEllipsis.cs
- PipelineModuleStepContainer.cs
- BitmapEncoder.cs
- List.cs
- SqlDataSourceSelectingEventArgs.cs
- SQLBytes.cs
- SingleBodyParameterMessageFormatter.cs
- VScrollBar.cs
- FormattedTextSymbols.cs
- NativeMethods.cs
- DataGridViewTextBoxColumn.cs
- SessionStateModule.cs
- Funcletizer.cs
- ConfigurationValidatorAttribute.cs
- TextWriterTraceListener.cs
- TextBoxDesigner.cs
- OdbcDataAdapter.cs
- DynamicILGenerator.cs