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:
 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

Paramètres

property
ConfigurationProperty

Objet ConfigurationProperty qui est candidat pour la sérialisation.

propertyName
String

Nom de l'objet ConfigurationProperty tel qu'il apparaît au format XML.

targetFramework
FrameworkName

Version cible du .NET Framework.

parentConfigurationElement
ConfigurationElement

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

Retours

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

Remarques

Chaque section de configuration créée pour .NET Framework 4 et versions 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 .NET Framework. Les sections de configuration existantes qui ont été créées pour les versions antérieures du .NET Framework ne doivent pas ê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 sont sérialisées pour toutes les versions du framework.

S’applique à

Voir aussi