Share via


ConfigurationSection.ShouldSerializeElementInTargetVersion Metoda

Definice

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

protected:
 virtual bool ShouldSerializeElementInTargetVersion(System::Configuration::ConfigurationElement ^ element, System::String ^ elementName, System::Runtime::Versioning::FrameworkName ^ targetFramework);
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, string elementName, System.Runtime.Versioning.FrameworkName targetFramework);
protected internal 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 Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean
Protected Friend Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean

Parametry

element
ConfigurationElement

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

elementName
String

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

targetFramework
FrameworkName

Cílová verze rozhraní .NET Framework.

Návraty

trueelement 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 , trueale pouze v případě, že zadaný prvek 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 nepřepíšete tuto metodu, budou ve výchozím nastavení všechny prvky konfigurace obsažené v oddílu konfigurace serializovány pro všechny verze architektury.

Platí pro

Viz také