ConfigurationProperty Constructors
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Overloads
| Name | Description |
|---|---|
| ConfigurationProperty(String, Type) |
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken. Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse. |
| ConfigurationProperty(String, Type, Object) |
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken. Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse. |
| ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) |
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken. Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) |
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken. Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) |
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken. Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse. |
ConfigurationProperty(String, Type)
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken.
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)
Parameters
- name
- String
De naam van de configuratie-entiteit.
- type
- Type
Het type van de configuratie-entiteit.
Van toepassing op
ConfigurationProperty(String, Type, Object)
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken.
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)
Parameters
- name
- String
De naam van de configuratie-entiteit.
- type
- Type
Het type van de configuratie-entiteit.
- defaultValue
- Object
De standaardwaarde van de configuratie-entiteit.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u de ConfigurationProperty.ConfigurationProperty(String, Type, Object) constructor gebruikt om een configuratie-eigenschapsobject te instantiëren.
// Initialize the _FileName property
_FileName =
new ConfigurationProperty("fileName",
typeof(string), "default.txt");
' Initialize the _FileName property
_FileName = New ConfigurationProperty( _
"fileName", GetType(String), "default.txt")
Opmerkingen
Wanneer u een ConfigurationProperty object instantiëren met behulp van deze constructor, worden de IsRequired en IsKey eigenschappen ingesteld op false. Bovendien werkt een exemplaar dat met deze constructor is gemaakt, niet als een standaardeigenschap voor verzamelingssleutels.
Zie ook
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Van toepassing op
ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken.
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)
Parameters
- name
- String
De naam van de configuratie-entiteit.
- type
- Type
Het type van de configuratie-entiteit.
- defaultValue
- Object
De standaardwaarde van de configuratie-entiteit.
- options
- ConfigurationPropertyOptions
Een van de ConfigurationPropertyOptions opsommingswaarden.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u een constructor gebruikt ConfigurationProperty.ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) om een configuratie-eigenschapsobject te instantiëren.
// 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)
Zie ook
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Van toepassing op
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions)
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken.
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)
Parameters
- name
- String
De naam van de configuratie-entiteit.
- type
- Type
Het type van de configuratie-entiteit.
- defaultValue
- Object
De standaardwaarde van de configuratie-entiteit.
- typeConverter
- TypeConverter
Het type conversieprogramma dat moet worden toegepast.
- validator
- ConfigurationValidatorBase
De validator die moet worden gebruikt.
- options
- ConfigurationPropertyOptions
Een van de ConfigurationPropertyOptions opsommingswaarden.
Voorbeelden
In het volgende codevoorbeeld ziet u het type parameters dat moet worden gebruikt bij het aanroepen van de ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) constructor.
// 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.]")
Zie ook
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Van toepassing op
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String)
Initialiseert een nieuw exemplaar van de ConfigurationProperty klasse.
Deze API ondersteunt de productinfrastructuur en is niet bedoeld om rechtstreeks vanuit de code te gebruiken.
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)
Parameters
- name
- String
De naam van de configuratie-entiteit.
- type
- Type
Het type van de configuratie-entiteit.
- defaultValue
- Object
De standaardwaarde van de configuratie-entiteit.
- typeConverter
- TypeConverter
Het type conversieprogramma dat moet worden toegepast.
- validator
- ConfigurationValidatorBase
De validator die moet worden gebruikt.
- options
- ConfigurationPropertyOptions
Een van de ConfigurationPropertyOptions opsommingswaarden.
- description
- String
De beschrijving van de configuratie-entiteit.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u de ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) constructor gebruikt om een configuratie-eigenschapsobject te instantiëren.
// 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.]")
Zie ook
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection