ConfigurationSection.ShouldSerializeElementInTargetVersion Metoda

Definice

Určuje, zda zadaný prvek má být serializován, když je hierarchie objektu konfigurace serializována pro zadanou cílovou verzi .NET Framework.

protected public:
 virtual bool ShouldSerializeElementInTargetVersion(System::Configuration::ConfigurationElement ^ element, System::String ^ elementName, System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected:
 virtual bool ShouldSerializeElementInTargetVersion(System::Configuration::ConfigurationElement ^ element, System::String ^ elementName, System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected internal virtual bool ShouldSerializeElementInTargetVersion(System.Configuration.ConfigurationElement element, string elementName, System.Runtime.Versioning.FrameworkName targetFramework);
protected virtual bool ShouldSerializeElementInTargetVersion(System.Configuration.ConfigurationElement element, string elementName, System.Runtime.Versioning.FrameworkName targetFramework);
abstract member ShouldSerializeElementInTargetVersion : System.Configuration.ConfigurationElement * string * System.Runtime.Versioning.FrameworkName -> bool
override this.ShouldSerializeElementInTargetVersion : System.Configuration.ConfigurationElement * string * System.Runtime.Versioning.FrameworkName -> bool
Protected Friend Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean
Protected Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean

Parametry

element
ConfigurationElement

Objekt ConfigurationElement , který je kandidátem pro serializaci.

elementName
String

Název objektu, který ConfigurationElement se vyskytuje v jazyce XML.

targetFramework
FrameworkName

Cílová verze rozhraní .NET Framework.

Návraty

true element pokud by měl být serializován; jinak , false.

Poznámky

Každá část konfigurace vytvořená pro .NET Framework 4 a novější verze musí explicitně přepsat tuto metodu a vrátit true, ale pouze pokud je zadaný prvek platný pro zadanou verzi .NET Framework. Stávající oddíly konfigurace vytvořené pro starší verze .NET Framework není nutné měnit.

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

Platí pro