Partilhar via


ConfigurationSection.ShouldSerializePropertyInTargetVersion Método

Definição

Indica se a propriedade especificada deve ser serializada quando a hierarquia de objetos de configuração é serializada para a versão de destino especificada do .NET Framework.

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, System::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);
protected 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 Friend Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean
Protected Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean

Parâmetros

property
ConfigurationProperty

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

propertyName
String

O nome do ConfigurationProperty objeto como ele ocorre em XML.

targetFramework
FrameworkName

A versão de destino do .NET Framework.

parentConfigurationElement
ConfigurationElement

O elemento pai da propriedade.

Retornos

true se o property 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 a propriedade especificada for válida 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 todas as propriedades de configuração contidas na seção de configuração serão serializadas para todas as versões da estrutura.

Aplica-se a