ConfigurationProperty Konstruktoren
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Überlädt
| Name | Beschreibung |
|---|---|
| ConfigurationProperty(String, Type) |
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht. Initialisiert eine neue Instanz der ConfigurationProperty-Klasse. |
| ConfigurationProperty(String, Type, Object) |
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht. Initialisiert eine neue Instanz der ConfigurationProperty-Klasse. |
| ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) |
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht. Initialisiert eine neue Instanz der ConfigurationProperty-Klasse. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) |
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht. Initialisiert eine neue Instanz der ConfigurationProperty-Klasse. |
| ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) |
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht. Initialisiert eine neue Instanz der ConfigurationProperty-Klasse. |
ConfigurationProperty(String, Type)
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.
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)
Parameter
- name
- String
Der Name der Konfigurationsentität.
- type
- Type
Der Typ der Konfigurationsentität.
Gilt für:
ConfigurationProperty(String, Type, Object)
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.
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)
Parameter
- name
- String
Der Name der Konfigurationsentität.
- type
- Type
Der Typ der Konfigurationsentität.
- defaultValue
- Object
Der Standardwert der Konfigurationsentität.
Beispiele
Im folgenden Codebeispiel wird gezeigt, wie sie mithilfe des ConfigurationProperty.ConfigurationProperty(String, Type, Object) Konstruktors ein Konfigurationseigenschaftsobjekt instanziieren.
// Initialize the _FileName property
_FileName =
new ConfigurationProperty("fileName",
typeof(string), "default.txt");
' Initialize the _FileName property
_FileName = New ConfigurationProperty( _
"fileName", GetType(String), "default.txt")
Hinweise
Wenn Sie ein ConfigurationProperty Objekt mithilfe dieses Konstruktors instanziieren, werden die IsRequired Eigenschaften IsKey auf false. Darüber hinaus funktioniert eine Instanz, die mit diesem Konstruktor erstellt wurde, nicht als Standardeigenschaft des Sammlungsschlüssels.
Weitere Informationen
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Gilt für:
ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.
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)
Parameter
- name
- String
Der Name der Konfigurationsentität.
- type
- Type
Der Typ der Konfigurationsentität.
- defaultValue
- Object
Der Standardwert der Konfigurationsentität.
- options
- ConfigurationPropertyOptions
Einer der ConfigurationPropertyOptions Enumerationswerte.
Beispiele
Das folgende Codebeispiel zeigt, wie Sie mithilfe ConfigurationProperty.ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) des Konstruktors ein Konfigurationseigenschaftsobjekt instanziieren.
// 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)
Weitere Informationen
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Gilt für:
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions)
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.
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)
Parameter
- name
- String
Der Name der Konfigurationsentität.
- type
- Type
Der Typ der Konfigurationsentität.
- defaultValue
- Object
Der Standardwert der Konfigurationsentität.
- typeConverter
- TypeConverter
Der Typ des anzuwendenden Konverters.
- validator
- ConfigurationValidatorBase
Der zu verwendende Validator.
- options
- ConfigurationPropertyOptions
Einer der ConfigurationPropertyOptions Enumerationswerte.
Beispiele
Das folgende Codebeispiel zeigt die Art von Parametern, die beim Aufrufen des ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) Konstruktors verwendet werden sollen.
// 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.]")
Weitere Informationen
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection
Gilt für:
ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String)
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
- Quelle:
- ConfigurationProperty.cs
Initialisiert eine neue Instanz der ConfigurationProperty-Klasse.
Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.
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)
Parameter
- name
- String
Der Name der Konfigurationsentität.
- type
- Type
Der Typ der Konfigurationsentität.
- defaultValue
- Object
Der Standardwert der Konfigurationsentität.
- typeConverter
- TypeConverter
Der Typ des anzuwendenden Konverters.
- validator
- ConfigurationValidatorBase
Der zu verwendende Validator.
- options
- ConfigurationPropertyOptions
Einer der ConfigurationPropertyOptions Enumerationswerte.
- description
- String
Die Beschreibung der Konfigurationsentität.
Beispiele
Im folgenden Codebeispiel wird gezeigt, wie sie mithilfe des ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) Konstruktors ein Konfigurationseigenschaftsobjekt instanziieren.
// 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.]")
Weitere Informationen
- ElementInformation
- ConfigurationElementCollection
- ConfigurationElementCollectionType
- ConfigurationElement
- ConfigurationPropertyCollection
- ConfigurationSection