ConfigurationProperty Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da ConfigurationProperty classe.
Sobrecargas
| Name | Description |
|---|---|
| ConfigurationProperty(String, Type) |
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir do seu código. Inicializa uma nova instância da ConfigurationProperty classe. |
| ConfigurationProperty(String, Type, Object) |
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir do seu código. Inicializa uma nova instância da ConfigurationProperty classe. |
| ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) |
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir do seu código. Inicializa uma nova instância da ConfigurationProperty classe. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) |
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir do seu código. Inicializa uma nova instância da ConfigurationProperty classe. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) |
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir do seu código. Inicializa uma nova instância da ConfigurationProperty classe. |
ConfigurationProperty(String, Type)
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
Inicializa uma nova instância da ConfigurationProperty classe.
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir 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
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
Inicializa uma nova instância da ConfigurationProperty classe.
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir 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 seguinte exemplo de código mostra como usar o ConfigurationProperty.ConfigurationProperty(String, Type, Object) construtor para instanciar um objeto de configuração de propriedade.
// Initialize the _FileName property
_FileName =
new ConfigurationProperty("fileName",
typeof(string), "default.txt");
' Initialize the _FileName property
_FileName = New ConfigurationProperty( _
"fileName", GetType(String), "default.txt")
Observações
Quando instancias um ConfigurationProperty objeto usando este construtor, as IsRequired propriedades e IsKey são definidas como false. Além disso, uma instância feita com este construtor não funcionará como propriedade de chave de coleção por defeito.
Ver também
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Aplica-se a
ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
Inicializa uma nova instância da ConfigurationProperty classe.
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir 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 ConfigurationPropertyOptions valores de enumeração.
Exemplos
O seguinte exemplo de código mostra como usar ConfigurationProperty.ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) o construtor para instanciar um objeto de propriedade de configuração.
// 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)
Ver também
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Aplica-se a
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions)
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
Inicializa uma nova instância da ConfigurationProperty classe.
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir 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 de conversor a aplicar.
- validator
- ConfigurationValidatorBase
O validador a usar.
- options
- ConfigurationPropertyOptions
Um dos ConfigurationPropertyOptions valores de enumeração.
Exemplos
O seguinte exemplo de código mostra o tipo de parâmetros a usar 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.]")
Ver também
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Aplica-se a
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String)
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
- Origem:
- ConfigurationProperty.cs
Inicializa uma nova instância da ConfigurationProperty classe.
Esta API suporta a infraestrutura de produtos e não é pressuposta para ser utilizada diretamente a partir 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 de conversor a aplicar.
- validator
- ConfigurationValidatorBase
O validador a usar.
- options
- ConfigurationPropertyOptions
Um dos ConfigurationPropertyOptions valores de enumeração.
- description
- String
A descrição da entidade de configuração.
Exemplos
O seguinte exemplo de código mostra como usar o ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) construtor para instanciar um objeto de configuração de propriedade.
// 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.]")
Ver também
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection