ConfigurationProperty Construtores

Definição

Inicializa uma nova instância da classe ConfigurationProperty.

Sobrecargas

ConfigurationProperty(String, Type)

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

Inicializa uma nova instância da classe ConfigurationProperty.

ConfigurationProperty(String, Type, Object)

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

Inicializa uma nova instância da classe ConfigurationProperty.

ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

Inicializa uma nova instância da classe ConfigurationProperty.

ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions)

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

Inicializa uma nova instância da classe ConfigurationProperty.

ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String)

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

Inicializa uma nova instância da classe ConfigurationProperty.

ConfigurationProperty(String, Type)

Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs

Inicializa uma nova instância da classe ConfigurationProperty.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 ConfigurationProperty(System::String ^ name, Type ^ type);
public ConfigurationProperty (string name, Type type);
new System.Configuration.ConfigurationProperty : string * Type -> System.Configuration.ConfigurationProperty
Public Sub New (name As String, type As Type)

Parâmetros

name
String

O nome da entidade de configuração.

type
Type

O tipo da entidade de configuração.

Aplica-se a

ConfigurationProperty(String, Type, Object)

Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs

Inicializa uma nova instância da classe ConfigurationProperty.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 ConfigurationProperty(System::String ^ name, Type ^ type, System::Object ^ defaultValue);
public ConfigurationProperty (string name, Type type, object defaultValue);
new System.Configuration.ConfigurationProperty : string * Type * obj -> System.Configuration.ConfigurationProperty
Public Sub New (name As String, type As Type, defaultValue As Object)

Parâmetros

name
String

O nome da entidade de configuração.

type
Type

O tipo da entidade de configuração.

defaultValue
Object

O valor padrão da entidade de configuração.

Exemplos

O exemplo de código a seguir mostra como usar o ConfigurationProperty.ConfigurationProperty(String, Type, Object) construtor para instanciar um objeto configuration-property.

// Initialize the _FileName property
_FileName =
    new ConfigurationProperty("fileName",
    typeof(string), "default.txt");
' Initialize the _FileName property
_FileName = New ConfigurationProperty( _
    "fileName", GetType(String), "default.txt")

Comentários

Quando você cria uma instância de um ConfigurationProperty objeto usando esse construtor, as IsRequired propriedades e IsKey são definidas como false. Além disso, uma instância feita com esse construtor não funcionará como uma propriedade de chave de coleção padrão.

Confira também

Aplica-se a

ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)

Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs

Inicializa uma nova instância da classe ConfigurationProperty.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 ConfigurationProperty(System::String ^ name, Type ^ type, System::Object ^ defaultValue, System::Configuration::ConfigurationPropertyOptions options);
public ConfigurationProperty (string name, Type type, object defaultValue, System.Configuration.ConfigurationPropertyOptions options);
new System.Configuration.ConfigurationProperty : string * Type * obj * System.Configuration.ConfigurationPropertyOptions -> System.Configuration.ConfigurationProperty
Public Sub New (name As String, type As Type, defaultValue As Object, options As ConfigurationPropertyOptions)

Parâmetros

name
String

O nome da entidade de configuração.

type
Type

O tipo da entidade de configuração.

defaultValue
Object

O valor padrão da entidade de configuração.

options
ConfigurationPropertyOptions

Um dos valores de enumeração ConfigurationPropertyOptions.

Exemplos

O exemplo de código a seguir mostra como usar ConfigurationProperty.ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) o construtor para instanciar um objeto configuration-property.

// Initialize the _MaxUsers property
_MaxUsers =
    new ConfigurationProperty("maxUsers",
    typeof(long), (long)1000,
    ConfigurationPropertyOptions.None);
' Initialize the _MaxUsers property
_MaxUsers = New ConfigurationProperty( _
    "maxUsers", GetType(Long), 1000L, _
    ConfigurationPropertyOptions.None)

Confira também

Aplica-se a

ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions)

Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs

Inicializa uma nova instância da classe ConfigurationProperty.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 ConfigurationProperty(System::String ^ name, Type ^ type, System::Object ^ defaultValue, System::ComponentModel::TypeConverter ^ typeConverter, System::Configuration::ConfigurationValidatorBase ^ validator, System::Configuration::ConfigurationPropertyOptions options);
public ConfigurationProperty (string name, Type type, object defaultValue, System.ComponentModel.TypeConverter typeConverter, System.Configuration.ConfigurationValidatorBase validator, System.Configuration.ConfigurationPropertyOptions options);
new System.Configuration.ConfigurationProperty : string * Type * obj * System.ComponentModel.TypeConverter * System.Configuration.ConfigurationValidatorBase * System.Configuration.ConfigurationPropertyOptions -> System.Configuration.ConfigurationProperty
Public Sub New (name As String, type As Type, defaultValue As Object, typeConverter As TypeConverter, validator As ConfigurationValidatorBase, options As ConfigurationPropertyOptions)

Parâmetros

name
String

O nome da entidade de configuração.

type
Type

O tipo da entidade de configuração.

defaultValue
Object

O valor padrão da entidade de configuração.

typeConverter
TypeConverter

O tipo do conversor a ser aplicado.

validator
ConfigurationValidatorBase

O validador a ser usado.

options
ConfigurationPropertyOptions

Um dos valores de enumeração ConfigurationPropertyOptions.

Exemplos

O exemplo de código a seguir mostra o tipo de parâmetros a serem usados ao chamar o ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) construtor.

// Initialize the _MaxIdleTime property
TimeSpan minTime = TimeSpan.FromSeconds(30);
TimeSpan maxTime = TimeSpan.FromMinutes(5);

ConfigurationValidatorBase _TimeSpanValidator =
    new TimeSpanValidator(minTime, maxTime, false);

_MaxIdleTime =
    new ConfigurationProperty("maxIdleTime",
    typeof(TimeSpan), TimeSpan.FromMinutes(5),
    TypeDescriptor.GetConverter(typeof(TimeSpan)),
    _TimeSpanValidator,
    ConfigurationPropertyOptions.IsRequired,
    "[Description:This is the max idle time.]");
' Initialize the _MaxIdleTime property
Dim minTime As TimeSpan = TimeSpan.FromSeconds(30)
Dim maxTime As TimeSpan = TimeSpan.FromMinutes(5)
Dim _TimeSpanValidator = _
    New TimeSpanValidator(minTime, maxTime, False)

_MaxIdleTime = New ConfigurationProperty( _
    "maxIdleTime", GetType(TimeSpan), _
    TimeSpan.FromMinutes(5), _
    TypeDescriptor.GetConverter(GetType(TimeSpan)), _
    _TimeSpanValidator, _
    ConfigurationPropertyOptions.IsRequired, _
    "[Description:This is the max idle time.]")

Confira também

Aplica-se a

ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String)

Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs
Origem:
ConfigurationProperty.cs

Inicializa uma nova instância da classe ConfigurationProperty.

Esta API dá suporte à infraestrutura do produto e não deve ser usada diretamente do seu código.

public:
 ConfigurationProperty(System::String ^ name, Type ^ type, System::Object ^ defaultValue, System::ComponentModel::TypeConverter ^ typeConverter, System::Configuration::ConfigurationValidatorBase ^ validator, System::Configuration::ConfigurationPropertyOptions options, System::String ^ description);
public ConfigurationProperty (string name, Type type, object defaultValue, System.ComponentModel.TypeConverter typeConverter, System.Configuration.ConfigurationValidatorBase validator, System.Configuration.ConfigurationPropertyOptions options, string description);
new System.Configuration.ConfigurationProperty : string * Type * obj * System.ComponentModel.TypeConverter * System.Configuration.ConfigurationValidatorBase * System.Configuration.ConfigurationPropertyOptions * string -> System.Configuration.ConfigurationProperty
Public Sub New (name As String, type As Type, defaultValue As Object, typeConverter As TypeConverter, validator As ConfigurationValidatorBase, options As ConfigurationPropertyOptions, description As String)

Parâmetros

name
String

O nome da entidade de configuração.

type
Type

O tipo da entidade de configuração.

defaultValue
Object

O valor padrão da entidade de configuração.

typeConverter
TypeConverter

O tipo do conversor a ser aplicado.

validator
ConfigurationValidatorBase

O validador a ser usado.

options
ConfigurationPropertyOptions

Um dos valores de enumeração ConfigurationPropertyOptions.

description
String

A descrição da entidade de configuração.

Exemplos

O exemplo de código a seguir mostra como usar o ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) construtor para instanciar um objeto configuration-property.

// Initialize the _MaxIdleTime property
TimeSpan minTime = TimeSpan.FromSeconds(30);
TimeSpan maxTime = TimeSpan.FromMinutes(5);

ConfigurationValidatorBase _TimeSpanValidator =
    new TimeSpanValidator(minTime, maxTime, false);

_MaxIdleTime =
    new ConfigurationProperty("maxIdleTime",
    typeof(TimeSpan), TimeSpan.FromMinutes(5),
    TypeDescriptor.GetConverter(typeof(TimeSpan)),
    _TimeSpanValidator,
    ConfigurationPropertyOptions.IsRequired,
    "[Description:This is the max idle time.]");
' Initialize the _MaxIdleTime property
Dim minTime As TimeSpan = TimeSpan.FromSeconds(30)
Dim maxTime As TimeSpan = TimeSpan.FromMinutes(5)
Dim _TimeSpanValidator = _
    New TimeSpanValidator(minTime, maxTime, False)

_MaxIdleTime = New ConfigurationProperty( _
    "maxIdleTime", GetType(TimeSpan), _
    TimeSpan.FromMinutes(5), _
    TypeDescriptor.GetConverter(GetType(TimeSpan)), _
    _TimeSpanValidator, _
    ConfigurationPropertyOptions.IsRequired, _
    "[Description:This is the max idle time.]")

Confira também

Aplica-se a