Partager via


ConfigurationSection.ShouldSerializePropertyInTargetVersion Méthode

Définition

Indique si la propriété spécifiée doit être sérialisée lorsque la hiérarchie d’objets de configuration est sérialisée pour la version cible spécifiée du .NET Framework.

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, System::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);
protected 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 Friend Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean
Protected Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean

Paramètres

property
ConfigurationProperty

Objet ConfigurationProperty candidat à la sérialisation.

propertyName
String

Nom de l’objet ConfigurationProperty tel qu’il se produit dans XML.

targetFramework
FrameworkName

Version cible du framework .NET.

parentConfigurationElement
ConfigurationElement

Élément parent de la propriété.

Retours

true si la property valeur doit être sérialisée ; sinon, false.

Remarques

Chaque section de configuration créée pour les versions .NET Framework 4 et ultérieures doit remplacer explicitement cette méthode et retourner true, mais uniquement si la propriété spécifiée est valide pour la version spécifiée du framework .NET. Les sections de configuration existantes qui ont été créées pour les versions antérieures de l’infrastructure .NET n’ont pas besoin d’être modifiées.

Le type de base contient une implémentation par défaut de cette méthode qui retourne truetoujours . Si vous implémentez une section de configuration et que vous ne remplacez pas cette méthode, par défaut, toutes les propriétés de configuration contenues dans la section de configuration seront sérialisées pour toutes les versions du framework.

S’applique à