Compartilhar via


ConfigurationSection.ShouldSerializeElementInTargetVersion Método

Definição

Indica se o elemento especificado deve ser serializado quando a hierarquia de objetos de configuração é serializada para a versão de destino especificada do .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

Parâmetros

element
ConfigurationElement

O ConfigurationElement objeto que é um candidato à serialização.

elementName
String

O nome do ConfigurationElement objeto como ele ocorre em XML.

targetFramework
FrameworkName

A versão de destino do .NET Framework.

Retornos

true se o element deve ser serializado; caso contrário, false.

Comentários

Cada seção de configuração criada para o .NET Framework 4 e versões posteriores deve substituir explicitamente esse método e retornar true, mas somente se o elemento especificado for válido para a versão especificada do .NET Framework. As seções de configuração existentes que foram criadas para versões anteriores do .NET Framework não precisam ser alteradas.

O tipo base contém uma implementação padrão desse método que sempre retorna true. Se você implementar uma seção de configuração e não substituir esse método, por padrão todos os elementos de configuração contidos na seção de configuração serão serializados para todas as versões da estrutura.

Aplica-se a