ConfigurationSection.ShouldSerializePropertyInTargetVersion Methode

Definition

Gibt an, ob die angegebene Eigenschaft serialisiert werden soll, wenn die Konfigurationsobjekthierarchie für die angegebene Zielversion des .NET Framework serialisiert wird.

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

Parameter

property
ConfigurationProperty

Das ConfigurationProperty-Objekt, das ein Kandidat für die Serialisierung ist.

propertyName
String

Der Name des ConfigurationProperty-Objekts in XML.

targetFramework
FrameworkName

Die Zielversion des .NET Framework.

parentConfigurationElement
ConfigurationElement

Das übergeordnete Element der Eigenschaft.

Gibt zurück

true, wenn property serialisiert werden soll, andernfalls false.

Hinweise

Jeder Konfigurationsabschnitt, der für die .NET Framework 4 und höher erstellt wird, muss diese Methode explizit überschreiben und zurückgebentrue, jedoch nur, wenn die angegebene Eigenschaft für die angegebene Version des .NET Framework gültig ist. Vorhandene Konfigurationsabschnitte, die für frühere Versionen der .NET Framework erstellt wurden, müssen nicht geändert werden.

Der Basistyp enthält eine Standardimplementierung dieser Methode, die immer zurückgibt true. Wenn Sie einen Konfigurationsabschnitt implementieren und diese Methode nicht überschreiben, werden standardmäßig alle Konfigurationseigenschaften, die im Konfigurationsabschnitt enthalten sind, für alle Frameworkversionen serialisiert.

Gilt für:

Weitere Informationen