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

propertyName
String

O nome do ConfigurationProperty objeto tal como aparece em XML.

targetFramework
FrameworkName

A versão alvo do .NET Framework.

parentConfigurationElement
ConfigurationElement

O elemento pai da propriedade.

Devoluções

true se o property 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 a propriedade especificada for válida 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 sobrepor este método, por defeito todas as propriedades de configuração contidas na secção de configuração serão serializadas para todas as versões do framework.

Aplica-se a

Ver também