DefaultValueAttribute 构造函数

定义

初始化 DefaultValueAttribute 类的新实例。

重载

名称 说明
DefaultValueAttribute(Boolean)

使用DefaultValueAttribute值初始化类的新实例Boolean

DefaultValueAttribute(Type, String)

初始化类的新实例 DefaultValueAttribute ,将指定值转换为指定类型,并使用固定区域性作为转换上下文。

DefaultValueAttribute(UInt64)

使用DefaultValueAttribute值初始化类的新实例UInt64

DefaultValueAttribute(UInt32)

使用DefaultValueAttribute值初始化类的新实例UInt32

DefaultValueAttribute(UInt16)

使用DefaultValueAttribute值初始化类的新实例UInt16

DefaultValueAttribute(String)

使用 DefaultValueAttribute.. 初始化类的新实例String

DefaultValueAttribute(SByte)

使用DefaultValueAttribute值初始化类的新实例SByte

DefaultValueAttribute(Single)

使用单精度浮点数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Int64)

使用 64 位带符号整数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Int32)

使用 32 位有符号整数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Int16)

使用 16 位有符号整数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Double)

使用双精度浮点数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Char)

使用 Unicode 字符初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Byte)

使用 8 位无符号整数初始化类的新实例 DefaultValueAttribute

DefaultValueAttribute(Object)

初始化 DefaultValueAttribute 类的新实例。

DefaultValueAttribute(Boolean)

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

使用DefaultValueAttribute值初始化类的新实例Boolean

public:
 DefaultValueAttribute(bool value);
public DefaultValueAttribute(bool value);
new System.ComponentModel.DefaultValueAttribute : bool -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Boolean)

参数

value
Boolean

一个 Boolean 是默认值。

适用于

DefaultValueAttribute(Type, String)

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

初始化类的新实例 DefaultValueAttribute ,将指定值转换为指定类型,并使用固定区域性作为转换上下文。

public:
 DefaultValueAttribute(Type ^ type, System::String ^ value);
public DefaultValueAttribute(Type type, string value);
public DefaultValueAttribute(Type type, string? value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
public DefaultValueAttribute(Type type, string? value);
new System.ComponentModel.DefaultValueAttribute : Type * string -> System.ComponentModel.DefaultValueAttribute
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")>]
new System.ComponentModel.DefaultValueAttribute : Type * string -> System.ComponentModel.DefaultValueAttribute
Public Sub New (type As Type, value As String)

参数

type
Type

一个 Type 表示要将值转换为的类型。

value
String

String可以使用该类型和美国英语区域性转换为类型TypeConverter

属性

适用于

DefaultValueAttribute(UInt64)

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

重要

此 API 不符合 CLS。

使用DefaultValueAttribute值初始化类的新实例UInt64

public:
 DefaultValueAttribute(System::UInt64 value);
[System.CLSCompliant(false)]
public DefaultValueAttribute(ulong value);
[<System.CLSCompliant(false)>]
new System.ComponentModel.DefaultValueAttribute : uint64 -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As ULong)

参数

value
UInt64

默认无符号长整数值。

属性

适用于

DefaultValueAttribute(UInt32)

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

重要

此 API 不符合 CLS。

使用DefaultValueAttribute值初始化类的新实例UInt32

public:
 DefaultValueAttribute(System::UInt32 value);
[System.CLSCompliant(false)]
public DefaultValueAttribute(uint value);
[<System.CLSCompliant(false)>]
new System.ComponentModel.DefaultValueAttribute : uint32 -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As UInteger)

参数

value
UInt32

默认无符号整数值。

属性

适用于

DefaultValueAttribute(UInt16)

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

重要

此 API 不符合 CLS。

使用DefaultValueAttribute值初始化类的新实例UInt16

public:
 DefaultValueAttribute(System::UInt16 value);
[System.CLSCompliant(false)]
public DefaultValueAttribute(ushort value);
[<System.CLSCompliant(false)>]
new System.ComponentModel.DefaultValueAttribute : uint16 -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As UShort)

参数

value
UInt16

默认无符号 16 位整数值。

属性

适用于

DefaultValueAttribute(String)

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

使用 DefaultValueAttribute.. 初始化类的新实例String

public:
 DefaultValueAttribute(System::String ^ value);
public DefaultValueAttribute(string value);
public DefaultValueAttribute(string? value);
new System.ComponentModel.DefaultValueAttribute : string -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As String)

参数

value
String

一个 String 是默认值。

适用于

DefaultValueAttribute(SByte)

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

重要

此 API 不符合 CLS。

使用DefaultValueAttribute值初始化类的新实例SByte

public:
 DefaultValueAttribute(System::SByte value);
[System.CLSCompliant(false)]
public DefaultValueAttribute(sbyte value);
[<System.CLSCompliant(false)>]
new System.ComponentModel.DefaultValueAttribute : sbyte -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As SByte)

参数

value
SByte

默认有符号字节值。

属性

适用于

DefaultValueAttribute(Single)

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

使用单精度浮点数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(float value);
public DefaultValueAttribute(float value);
new System.ComponentModel.DefaultValueAttribute : single -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Single)

参数

value
Single

一个单精度浮点数,它是默认值。

适用于

DefaultValueAttribute(Int64)

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

使用 64 位带符号整数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(long value);
public DefaultValueAttribute(long value);
new System.ComponentModel.DefaultValueAttribute : int64 -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Long)

参数

value
Int64

一个 64 位有符号整数,它是默认值。

适用于

DefaultValueAttribute(Int32)

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

使用 32 位有符号整数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(int value);
public DefaultValueAttribute(int value);
new System.ComponentModel.DefaultValueAttribute : int -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Integer)

参数

value
Int32

一个 32 位有符号整数,它是默认值。

适用于

DefaultValueAttribute(Int16)

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

使用 16 位有符号整数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(short value);
public DefaultValueAttribute(short value);
new System.ComponentModel.DefaultValueAttribute : int16 -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Short)

参数

value
Int16

一个 16 位有符号整数,它是默认值。

适用于

DefaultValueAttribute(Double)

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

使用双精度浮点数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(double value);
public DefaultValueAttribute(double value);
new System.ComponentModel.DefaultValueAttribute : double -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Double)

参数

value
Double

一个双精度浮点数,它是默认值。

适用于

DefaultValueAttribute(Char)

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

使用 Unicode 字符初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(char value);
public DefaultValueAttribute(char value);
new System.ComponentModel.DefaultValueAttribute : char -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Char)

参数

value
Char

默认值为 Unicode 字符。

适用于

DefaultValueAttribute(Byte)

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

使用 8 位无符号整数初始化类的新实例 DefaultValueAttribute

public:
 DefaultValueAttribute(System::Byte value);
public DefaultValueAttribute(byte value);
new System.ComponentModel.DefaultValueAttribute : byte -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Byte)

参数

value
Byte

默认值为 8 位无符号整数。

适用于

DefaultValueAttribute(Object)

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

初始化 DefaultValueAttribute 类的新实例。

public:
 DefaultValueAttribute(System::Object ^ value);
public DefaultValueAttribute(object value);
public DefaultValueAttribute(object? value);
new System.ComponentModel.DefaultValueAttribute : obj -> System.ComponentModel.DefaultValueAttribute
Public Sub New (value As Object)

参数

value
Object

表示默认值的一个 Object

适用于