ConfigurationSection.ShouldSerializePropertyInTargetVersion Metod

Definition

Anger om den angivna egenskapen ska serialiseras när konfigurationsobjekthierarkin serialiseras för den angivna målversionen av .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

Parametrar

property
ConfigurationProperty

Objektet ConfigurationProperty som är en kandidat för serialisering.

propertyName
String

Namnet på ConfigurationProperty objektet som det inträffar i XML.

targetFramework
FrameworkName

Målversionen av .NET Framework.

parentConfigurationElement
ConfigurationElement

Det överordnade elementet i egenskapen.

Returer

true property om ska serialiseras, annars . false

Kommentarer

Varje konfigurationsavsnitt som skapas för .NET Framework 4 och senare versioner måste uttryckligen åsidosätta den här metoden och returnera true, men endast om den angivna egenskapen är giltig för den angivna versionen av .NET Framework. Befintliga konfigurationsavsnitt som har skapats för tidigare versioner av .NET Framework behöver inte ändras.

Bastypen innehåller en standardimplementering av den här metoden som alltid returnerar true. Om du implementerar ett konfigurationsavsnitt och inte åsidosätter den här metoden kommer som standard alla konfigurationsegenskaper som finns i konfigurationsavsnittet serialiseras för alla ramverksversioner.

Gäller för

Se även