Code:
                         / DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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) { 
        } 
    }
} 
                        
                        
                        
                        
                    Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SplineQuaternionKeyFrame.cs
 - ProgramPublisher.cs
 - Label.cs
 - DataSourceUtil.cs
 - Literal.cs
 - ValidationEventArgs.cs
 - SoundPlayer.cs
 - webproxy.cs
 - SQLRoleProvider.cs
 - SRGSCompiler.cs
 - QilSortKey.cs
 - COMException.cs
 - DataColumnCollection.cs
 - ControlAdapter.cs
 - _OSSOCK.cs
 - Dynamic.cs
 - Switch.cs
 - WrappedIUnknown.cs
 - ObjectDataSourceView.cs
 - ContainerTracking.cs
 - SerializerProvider.cs
 - SqlWebEventProvider.cs
 - TableStyle.cs
 - XmlTextReaderImplHelpers.cs
 - DocumentSchemaValidator.cs
 - TypeSystem.cs
 - PropertyCollection.cs
 - SspiNegotiationTokenAuthenticator.cs
 - MimeReflector.cs
 - FileRegion.cs
 - CodeFieldReferenceExpression.cs
 - ImageAutomationPeer.cs
 - CriticalFinalizerObject.cs
 - ImageEditor.cs
 - FrameworkContentElementAutomationPeer.cs
 - XmlNodeList.cs
 - EntityDataSourceColumn.cs
 - TemplateComponentConnector.cs
 - ApplicationBuildProvider.cs
 - XsdValidatingReader.cs
 - ExpandSegmentCollection.cs
 - DateTimeSerializationSection.cs
 - CounterCreationDataCollection.cs
 - MissingManifestResourceException.cs
 - DropDownHolder.cs
 - TdsEnums.cs
 - TextEndOfParagraph.cs
 - TemplateControlCodeDomTreeGenerator.cs
 - SafePEFileHandle.cs
 - LicenseProviderAttribute.cs
 - CatalogZoneAutoFormat.cs
 - MouseBinding.cs
 - TypeInitializationException.cs
 - BaseCollection.cs
 - ReadWriteObjectLock.cs
 - InputScopeAttribute.cs
 - BreakRecordTable.cs
 - SrgsSubset.cs
 - HtmlInputHidden.cs
 - WindowsToolbarItemAsMenuItem.cs
 - WmpBitmapEncoder.cs
 - CodeCommentStatementCollection.cs
 - NoResizeHandleGlyph.cs
 - CollectionsUtil.cs
 - XmlEntity.cs
 - CacheVirtualItemsEvent.cs
 - FixedDocument.cs
 - GridViewDeletedEventArgs.cs
 - ParameterModifier.cs
 - EventProxy.cs
 - DependencyPropertyConverter.cs
 - IntSecurity.cs
 - TableLayoutStyleCollection.cs
 - CommonProperties.cs
 - DatatypeImplementation.cs
 - DataGridCommandEventArgs.cs
 - StrokeDescriptor.cs
 - CriticalHandle.cs
 - ListViewContainer.cs
 - PointHitTestParameters.cs
 - AspProxy.cs
 - RegexRunnerFactory.cs
 - StorageBasedPackageProperties.cs
 - XmlObjectSerializerReadContextComplexJson.cs
 - ListenerElementsCollection.cs
 - TextLine.cs
 - CorePropertiesFilter.cs
 - ToolStripDesignerAvailabilityAttribute.cs
 - FSWPathEditor.cs
 - GridViewSortEventArgs.cs
 - SmiEventStream.cs
 - MaxMessageSizeStream.cs
 - EventLogPermissionEntry.cs
 - OleDbSchemaGuid.cs
 - DbDataRecord.cs
 - EventBuilder.cs
 - PathTooLongException.cs
 - ChannelPoolSettingsElement.cs
 - CodeNamespaceImportCollection.cs
 - ProcessStartInfo.cs