Olvasás angol nyelven Szerkesztés

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


DefaultValueAttribute Constructors

Definition

Initializes a new instance of the DefaultValueAttribute class.

Overloads

DefaultValueAttribute(Boolean)

Initializes a new instance of the DefaultValueAttribute class using a Boolean value.

DefaultValueAttribute(Type, String)

Initializes a new instance of the DefaultValueAttribute class, converting the specified value to the specified type, and using an invariant culture as the translation context.

DefaultValueAttribute(UInt64)

Initializes a new instance of the DefaultValueAttribute class using a UInt64 value.

DefaultValueAttribute(UInt32)

Initializes a new instance of the DefaultValueAttribute class using a UInt32 value.

DefaultValueAttribute(UInt16)

Initializes a new instance of the DefaultValueAttribute class using a UInt16 value.

DefaultValueAttribute(String)

Initializes a new instance of the DefaultValueAttribute class using a String.

DefaultValueAttribute(SByte)

Initializes a new instance of the DefaultValueAttribute class using a SByte value.

DefaultValueAttribute(Single)

Initializes a new instance of the DefaultValueAttribute class using a single-precision floating point number.

DefaultValueAttribute(Int64)

Initializes a new instance of the DefaultValueAttribute class using a 64-bit signed integer.

DefaultValueAttribute(Int32)

Initializes a new instance of the DefaultValueAttribute class using a 32-bit signed integer.

DefaultValueAttribute(Int16)

Initializes a new instance of the DefaultValueAttribute class using a 16-bit signed integer.

DefaultValueAttribute(Double)

Initializes a new instance of the DefaultValueAttribute class using a double-precision floating point number.

DefaultValueAttribute(Char)

Initializes a new instance of the DefaultValueAttribute class using a Unicode character.

DefaultValueAttribute(Byte)

Initializes a new instance of the DefaultValueAttribute class using an 8-bit unsigned integer.

DefaultValueAttribute(Object)

Initializes a new instance of the DefaultValueAttribute class.

DefaultValueAttribute(Boolean)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a Boolean value.

C#
public DefaultValueAttribute(bool value);

Parameters

value
Boolean

A Boolean that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Type, String)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class, converting the specified value to the specified type, and using an invariant culture as the translation context.

C#
public DefaultValueAttribute(Type type, string value);
C#
public DefaultValueAttribute(Type type, string? value);

Parameters

type
Type

A Type that represents the type to convert the value to.

value
String

A String that can be converted to the type using the TypeConverter for the type and the U.S. English culture.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(UInt64)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Important

This API is not CLS-compliant.

Initializes a new instance of the DefaultValueAttribute class using a UInt64 value.

C#
[System.CLSCompliant(false)]
public DefaultValueAttribute(ulong value);

Parameters

value
UInt64

The default unsigned long integer value.

Attributes

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 Standard 2.1

DefaultValueAttribute(UInt32)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Important

This API is not CLS-compliant.

Initializes a new instance of the DefaultValueAttribute class using a UInt32 value.

C#
[System.CLSCompliant(false)]
public DefaultValueAttribute(uint value);

Parameters

value
UInt32

The default unsigned integer value.

Attributes

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 Standard 2.1

DefaultValueAttribute(UInt16)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Important

This API is not CLS-compliant.

Initializes a new instance of the DefaultValueAttribute class using a UInt16 value.

C#
[System.CLSCompliant(false)]
public DefaultValueAttribute(ushort value);

Parameters

value
UInt16

The default unsigned 16-bit integer value.

Attributes

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 Standard 2.1

DefaultValueAttribute(String)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a String.

C#
public DefaultValueAttribute(string value);
C#
public DefaultValueAttribute(string? value);

Parameters

value
String

A String that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(SByte)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Important

This API is not CLS-compliant.

Initializes a new instance of the DefaultValueAttribute class using a SByte value.

C#
[System.CLSCompliant(false)]
public DefaultValueAttribute(sbyte value);

Parameters

value
SByte

The default signed byte value.

Attributes

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 Standard 2.1

DefaultValueAttribute(Single)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a single-precision floating point number.

C#
public DefaultValueAttribute(float value);

Parameters

value
Single

A single-precision floating point number that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Int64)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a 64-bit signed integer.

C#
public DefaultValueAttribute(long value);

Parameters

value
Int64

A 64-bit signed integer that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Int32)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a 32-bit signed integer.

C#
public DefaultValueAttribute(int value);

Parameters

value
Int32

A 32-bit signed integer that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Int16)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a 16-bit signed integer.

C#
public DefaultValueAttribute(short value);

Parameters

value
Int16

A 16-bit signed integer that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Double)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a double-precision floating point number.

C#
public DefaultValueAttribute(double value);

Parameters

value
Double

A double-precision floating point number that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Char)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using a Unicode character.

C#
public DefaultValueAttribute(char value);

Parameters

value
Char

A Unicode character that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Byte)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class using an 8-bit unsigned integer.

C#
public DefaultValueAttribute(byte value);

Parameters

value
Byte

An 8-bit unsigned integer that is the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

DefaultValueAttribute(Object)

Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs
Source:
DefaultValueAttribute.cs

Initializes a new instance of the DefaultValueAttribute class.

C#
public DefaultValueAttribute(object value);
C#
public DefaultValueAttribute(object? value);

Parameters

value
Object

An Object that represents the default value.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 1.0, Core 1.1, 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 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0