Share via


ConfigurationProperty Konstruktory

Definice

Inicializuje novou instanci ConfigurationProperty třídy.

Přetížení

ConfigurationProperty(String, Type)

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

Inicializuje novou instanci ConfigurationProperty třídy.

ConfigurationProperty(String, Type, Object)

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

Inicializuje novou instanci ConfigurationProperty třídy.

ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

Inicializuje novou instanci ConfigurationProperty třídy.

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

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

Inicializuje novou instanci ConfigurationProperty třídy.

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

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

Inicializuje novou instanci ConfigurationProperty třídy.

ConfigurationProperty(String, Type)

Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs

Inicializuje novou instanci ConfigurationProperty třídy.

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

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)

Parametry

name
String

Název entity konfigurace.

type
Type

Typ entity konfigurace.

Platí pro

ConfigurationProperty(String, Type, Object)

Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs

Inicializuje novou instanci ConfigurationProperty třídy.

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

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)

Parametry

name
String

Název entity konfigurace.

type
Type

Typ entity konfigurace.

defaultValue
Object

Výchozí hodnota entity konfigurace.

Příklady

Následující příklad kódu ukazuje, jak pomocí konstruktoru ConfigurationProperty.ConfigurationProperty(String, Type, Object) vytvořit instanci objektu 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")

Poznámky

Při vytváření instance objektu ConfigurationProperty pomocí tohoto konstruktoru IsRequired jsou vlastnosti a IsKey nastaveny na falsehodnotu . Kromě toho instance vytvořená pomocí tohoto konstruktoru nebude fungovat jako výchozí vlastnost klíče kolekce.

Viz také

Platí pro

ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions)

Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs

Inicializuje novou instanci ConfigurationProperty třídy.

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

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)

Parametry

name
String

Název entity konfigurace.

type
Type

Typ entity konfigurace.

defaultValue
Object

Výchozí hodnota entity konfigurace.

Příklady

Následující příklad kódu ukazuje, jak pomocí ConfigurationProperty.ConfigurationProperty(String, Type, Object, ConfigurationPropertyOptions) konstruktoru vytvořit instanci objektu 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)

Viz také

Platí pro

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

Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs

Inicializuje novou instanci ConfigurationProperty třídy.

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

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)

Parametry

name
String

Název entity konfigurace.

type
Type

Typ entity konfigurace.

defaultValue
Object

Výchozí hodnota entity konfigurace.

typeConverter
TypeConverter

Typ převaděče, který se má použít.

validator
ConfigurationValidatorBase

Validátor, který se má použít.

Příklady

Následující příklad kódu ukazuje typ parametrů, které se mají použít při volání konstruktoru ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions) .

// 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.]")

Viz také

Platí pro

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

Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs
Zdroj:
ConfigurationProperty.cs

Inicializuje novou instanci ConfigurationProperty třídy.

Toto rozhraní API podporuje produktovou infrastrukturu a není určené k použití přímo z uživatelského kódu.

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)

Parametry

name
String

Název entity konfigurace.

type
Type

Typ entity konfigurace.

defaultValue
Object

Výchozí hodnota entity konfigurace.

typeConverter
TypeConverter

Typ převaděče, který se má použít.

validator
ConfigurationValidatorBase

Validátor, který se má použít.

description
String

Popis entity konfigurace.

Příklady

Následující příklad kódu ukazuje, jak pomocí konstruktoru ConfigurationProperty.ConfigurationProperty(String, Type, Object, TypeConverter, ConfigurationValidatorBase, ConfigurationPropertyOptions, String) vytvořit instanci objektu 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.]")

Viz také

Platí pro