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:
 virtual bool ShouldSerializePropertyInTargetVersion(System::Configuration::ConfigurationProperty ^ property, System::String ^ propertyName, System::Runtime::Versioning::FrameworkName ^ targetFramework, System::Configuration::ConfigurationElement ^ parentConfigurationElement);
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, 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);
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 Overridable Function ShouldSerializePropertyInTargetVersion (property As ConfigurationProperty, propertyName As String, targetFramework As FrameworkName, parentConfigurationElement As ConfigurationElement) As Boolean
Protected Friend 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 objeto ConfigurationProperty tal como aparece en XML.

targetFramework
FrameworkName

Versión de destino de .NET Framework.

parentConfigurationElement
ConfigurationElement

Elemento primario de la propiedad.

Devoluciones

true si property debe serializarse; de lo contrario, false.

Comentarios

Cada sección de configuración que se crea 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

Consulte también