Comparteix a través de


ConfigurationSection.ShouldSerializePropertyInTargetVersion Método

Definición

Indica si la propiedad especificada se debe serializar cuando la jerarquía de objetos de configuración se serializa para la versión de destino especificada de .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

Objeto ConfigurationProperty que es un candidato para la serialización.

propertyName
String

Nombre del ConfigurationProperty objeto tal y como se produce en XML.

targetFramework
FrameworkName

Versión de destino de .NET Framework.

parentConfigurationElement
ConfigurationElement

Elemento primario de la propiedad .

Devoluciones

true property es si se debe serializar; de lo contrario, falsees .

Comentarios

Cada sección de configuración creada para .NET Framework 4 y versiones posteriores debe invalidar explícitamente este método y devolver true, pero solo si la propiedad especificada es válida para la versión especificada de .NET Framework. Las secciones de configuración existentes que se crearon para versiones anteriores de .NET Framework no tienen que cambiarse.

El tipo base contiene una implementación predeterminada de este método que siempre devuelve true. Si implementa una sección de configuración y no invalida este método, todas las propiedades de configuración contenidas en la sección de configuración se serializarán para todas las versiones del marco.

Se aplica a