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 alvo 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 é candidato à serialização.

elementName
String

O nome do ConfigurationElement objeto tal como aparece em XML.

targetFramework
FrameworkName

A versão alvo do .NET Framework.

Devoluções

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

Observações

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

O tipo base contém uma implementação padrão deste método que devolve truesempre . Se implementar uma secção de configuração e não sobrescrever este método, por defeito todos os elementos de configuração contidos na secção de configuração serão serializados para todas as versões do framework.

Aplica-se a

Ver também