InvalidEnumArgumentException Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy InvalidEnumArgumentException.

Przeciążenia

InvalidEnumArgumentException()

Inicjuje InvalidEnumArgumentException nowe wystąpienie klasy bez komunikatu.

InvalidEnumArgumentException(String)

Inicjuje nowe wystąpienie klasy InvalidEnumArgumentException z określonym komunikatem.

InvalidEnumArgumentException(SerializationInfo, StreamingContext)
Przestarzałe.

Inicjuje InvalidEnumArgumentException nowe wystąpienie klasy przy użyciu określonych danych serializacji i kontekstu.

InvalidEnumArgumentException(String, Exception)

Inicjuje nowe wystąpienie InvalidEnumArgumentException klasy z określonym szczegółowym opisem i określonym wyjątkiem.

InvalidEnumArgumentException(String, Int32, Type)

Inicjuje nowe wystąpienie InvalidEnumArgumentException klasy z komunikatem wygenerowanym na podstawie argumentu, nieprawidłową wartością i klasą wyliczenia.

InvalidEnumArgumentException()

Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs

Inicjuje InvalidEnumArgumentException nowe wystąpienie klasy bez komunikatu.

C#
public InvalidEnumArgumentException ();

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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)

Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs

Inicjuje nowe wystąpienie klasy InvalidEnumArgumentException z określonym komunikatem.

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

Parametry

message
String

Komunikat do wyświetlenia z tym wyjątkiem.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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)

Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs

Przestroga

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

Inicjuje InvalidEnumArgumentException nowe wystąpienie klasy przy użyciu określonych danych serializacji i kontekstu.

C#
protected InvalidEnumArgumentException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext 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);

Parametry

info
SerializationInfo

Element SerializationInfo , który ma być używany do deserializacji.

context
StreamingContext

Miejsce docelowe, które ma być używane do deserializacji.

Atrybuty

Dotyczy

.NET 9 i inne wersje
Produkt Wersje (Przestarzałe)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9)
.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)

Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs

Inicjuje nowe wystąpienie InvalidEnumArgumentException klasy z określonym szczegółowym opisem i określonym wyjątkiem.

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

Parametry

message
String

Szczegółowy opis błędu.

innerException
Exception

Odwołanie do wyjątku wewnętrznego, który jest przyczyną tego wyjątku.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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)

Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs
Źródło:
InvalidEnumArgumentException.cs

Inicjuje nowe wystąpienie InvalidEnumArgumentException klasy z komunikatem wygenerowanym na podstawie argumentu, nieprawidłową wartością i klasą wyliczenia.

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

Parametry

argumentName
String

Nazwa argumentu, który spowodował wyjątek.

invalidValue
Int32

Wartość argumentu, który zakończył się niepowodzeniem.

enumClass
Type

Element Type reprezentujący klasę wyliczenia z prawidłowymi wartościami.

Uwagi

Ten konstruktor utworzy zlokalizowany komunikat z informacją, że argumentName parametr był nieprawidłowy, ponieważ przekazana wartość była nieprawidłowa i że wartość powinna być jedną z wartości w klasie wyliczenia.

Dotyczy

.NET 9 i inne wersje
Produkt Wersje
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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