ConfigurationSection.ShouldSerializePropertyInTargetVersion Metoda

Definicja

Wskazuje, czy określona właściwość powinna być serializowana, gdy hierarchia obiektów konfiguracji jest serializowana dla określonej wersji docelowej .NET Framework.

protected:
 virtual bool ShouldSerializePropertyInTargetVersion(System::Configuration::ConfigurationProperty ^ property, System::String ^ propertyName, System::Runtime::Versioning::FrameworkName ^ targetFramework, System::Configuration::ConfigurationElement ^ parentConfigurationElement);
protected public:
 virtual bool ShouldSerializePropertyInTargetVersion(System::Configuration::ConfigurationProperty ^ property, System::String ^ propertyName, System::Runtime::Versioning::FrameworkName ^ targetFramework, System::Configuration::ConfigurationElement ^ parentConfigurationElement);
protected virtual bool ShouldSerializePropertyInTargetVersion (System.Configuration.ConfigurationProperty property, string propertyName, System.Runtime.Versioning.FrameworkName targetFramework, System.Configuration.ConfigurationElement parentConfigurationElement);
protected internal virtual bool ShouldSerializePropertyInTargetVersion (System.Configuration.ConfigurationProperty property, string propertyName, System.Runtime.Versioning.FrameworkName targetFramework, System.Configuration.ConfigurationElement parentConfigurationElement);
abstract member ShouldSerializePropertyInTargetVersion : System.Configuration.ConfigurationProperty * string * System.Runtime.Versioning.FrameworkName * System.Configuration.ConfigurationElement -> bool
override this.ShouldSerializePropertyInTargetVersion : System.Configuration.ConfigurationProperty * string * System.Runtime.Versioning.FrameworkName * System.Configuration.ConfigurationElement -> bool
Protected Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean
Protected Friend Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean

Parametry

property
ConfigurationProperty

ConfigurationProperty Obiekt, który jest kandydatem do serializacji.

propertyName
String

Nazwa ConfigurationProperty obiektu, który występuje w formacie XML.

targetFramework
FrameworkName

Wersja docelowa .NET Framework.

parentConfigurationElement
ConfigurationElement

Element nadrzędny właściwości .

Zwraca

trueproperty jeśli element powinien zostać zserializowany; w przeciwnym razie . false

Uwagi

Każda sekcja konfiguracji utworzona dla .NET Framework 4 i nowszych wersji musi jawnie zastąpić tę metodę i zwrócić truewartość , ale tylko wtedy, gdy określona właściwość jest prawidłowa dla określonej wersji .NET Framework. Istniejące sekcje konfiguracji utworzone dla wcześniejszych wersji .NET Framework nie muszą być zmieniane.

Typ podstawowy zawiera domyślną implementację tej metody, która zawsze zwraca wartość true. Jeśli zaimplementujesz sekcję konfiguracji i nie zastąpisz tej metody, domyślnie wszystkie właściwości konfiguracji zawarte w sekcji konfiguracji zostaną serializowane dla wszystkich wersji platformy.

Dotyczy

Zobacz też