Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


InvalidEnumArgumentException Constructors

Definition

Initializes a new instance of the InvalidEnumArgumentException class.

Overloads

InvalidEnumArgumentException()

Initializes a new instance of the InvalidEnumArgumentException class without a message.

InvalidEnumArgumentException(String)

Initializes a new instance of the InvalidEnumArgumentException class with the specified message.

InvalidEnumArgumentException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the InvalidEnumArgumentException class using the specified serialization data and context.

InvalidEnumArgumentException(String, Exception)

Initializes a new instance of the InvalidEnumArgumentException class with the specified detailed description and the specified exception.

InvalidEnumArgumentException(String, Int32, Type)

Initializes a new instance of the InvalidEnumArgumentException class with a message generated from the argument, the invalid value, and an enumeration class.

InvalidEnumArgumentException()

Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs

Initializes a new instance of the InvalidEnumArgumentException class without a message.

C#
public InvalidEnumArgumentException();

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

InvalidEnumArgumentException(String)

Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs

Initializes a new instance of the InvalidEnumArgumentException class with the specified message.

C#
public InvalidEnumArgumentException(string? message);
C#
public InvalidEnumArgumentException(string message);

Parameters

message
String

The message to display with this exception.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

InvalidEnumArgumentException(SerializationInfo, StreamingContext)

Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the InvalidEnumArgumentException class using the specified serialization data and context.

C#
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected InvalidEnumArgumentException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
C#
protected InvalidEnumArgumentException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);

Parameters

info
SerializationInfo

The SerializationInfo to be used for deserialization.

context
StreamingContext

The destination to be used for deserialization.

Attributes

Applies to

.NET 10 és más verziók
Termék Verziók (Elavult)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

InvalidEnumArgumentException(String, Exception)

Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs

Initializes a new instance of the InvalidEnumArgumentException class with the specified detailed description and the specified exception.

C#
public InvalidEnumArgumentException(string? message, Exception? innerException);
C#
public InvalidEnumArgumentException(string message, Exception innerException);

Parameters

message
String

A detailed description of the error.

innerException
Exception

A reference to the inner exception that is the cause of this exception.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

InvalidEnumArgumentException(String, Int32, Type)

Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs
Source:
InvalidEnumArgumentException.cs

Initializes a new instance of the InvalidEnumArgumentException class with a message generated from the argument, the invalid value, and an enumeration class.

C#
public InvalidEnumArgumentException(string? argumentName, int invalidValue, Type enumClass);
C#
public InvalidEnumArgumentException(string argumentName, int invalidValue, Type enumClass);

Parameters

argumentName
String

The name of the argument that caused the exception.

invalidValue
Int32

The value of the argument that failed.

enumClass
Type

A Type that represents the enumeration class with the valid values.

Remarks

This constructor will create a localized message saying that the argumentName parameter was invalid because the value passed in was invalid, and that the value should be one of the values in the enumeration class.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1