ConfigurationSection.ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement) ConfigurationSection.ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement) ConfigurationSection.ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement) ConfigurationSection.ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement) Method

Definición

Indica si se debe serializar la propiedad especificada cuando la jerarquía de objetos de configuración se serializa para la versión de destino especificada de .NET Framework.NET Framework.Indicates whether the specified property should be serialized when the configuration object hierarchy is serialized for the specified target version of the .NET Framework.NET Framework.

protected public:
 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);
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

Parámetros

property
ConfigurationProperty ConfigurationProperty ConfigurationProperty ConfigurationProperty

Objeto ConfigurationProperty que es un candidato para la serialización.The ConfigurationProperty object that is a candidate for serialization.

propertyName
String String String String

Nombre del objeto ConfigurationProperty tal como aparece en XML.The name of the ConfigurationProperty object as it occurs in XML.

targetFramework
FrameworkName FrameworkName FrameworkName FrameworkName

Versión de destino de .NET Framework.NET Framework.The target version of the .NET Framework.NET Framework.

parentConfigurationElement
ConfigurationElement ConfigurationElement ConfigurationElement ConfigurationElement

Elemento primario de la propiedad.The parent element of the property.

Devoluciones

true si property debe serializarse; de lo contrario, false.true if the property should be serialized; otherwise, false.

Comentarios

Cada sección de configuración que se crea para .NET Framework 4.NET Framework 4 y versiones posteriores debe invalidar explícitamente este método truey devolver, pero solo si la propiedad especificada es válida para .NET Framework.NET Frameworkla versión especificada de.Each configuration section that is created for the .NET Framework 4.NET Framework 4 and later versions must explicitly override this method and return true, but only if the specified property is valid for the specified version of the .NET Framework.NET Framework. No es necesario cambiar las secciones de configuración existentes que se .NET Framework.NET Framework crearon para versiones anteriores de.Existing configuration sections that were created for earlier versions of the .NET Framework.NET Framework do not have to be changed.

El tipo base contiene una implementación predeterminada de este método que siempre devuelve true.The base type contains a default implementation of this method that always returns true. Si implementa una sección de configuración y no invalida este método, de forma predeterminada, todas las propiedades de configuración incluidas en la sección de configuración se serializarán para todas las versiones de .NET Framework.If you implement a configuration section and you do not override this method, by default all configuration properties that are contained in the configuration section will be serialized for all framework versions.

Se aplica a

Consulte también: