ConfigurationSection.ShouldSerializePropertyInTargetVersion Metoda

Definice

Určuje, zda má být zadaná vlastnost serializována při hierarchii objektů konfigurace serializována pro zadanou cílovou verzi rozhraní .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

Objekt ConfigurationProperty , který je kandidátem na serializaci.

propertyName
String

Název objektu tak, ConfigurationProperty jak se vyskytuje v XML.

targetFramework
FrameworkName

Cílová verze rozhraní .NET Framework.

parentConfigurationElement
ConfigurationElement

Nadřazený prvek vlastnosti.

Návraty

trueproperty pokud by měl být serializován; v opačném případě . false

Poznámky

Každý oddíl konfigurace, který je vytvořen pro rozhraní .NET Framework 4 a novější verze musí explicitně přepsat tuto metodu a vrátit true, ale pouze v případě, že zadaná vlastnost je platná pro zadanou verzi rozhraní .NET Framework. Existující konfigurační oddíly, které byly vytvořeny pro dřívější verze rozhraní .NET Framework, není nutné měnit.

Základní typ obsahuje výchozí implementaci této metody, která vždy vrací true. Pokud implementujete oddíl konfigurace a tuto metodu nepřepíšete, budou ve výchozím nastavení všechny vlastnosti konfigurace obsažené v oddílu konfigurace serializovány pro všechny verze architektury.

Platí pro

Viz také