ConfigurationSection.ShouldSerializeElementInTargetVersion Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Indica si el elemento especificado 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 ShouldSerializeElementInTargetVersion(System::Configuration::ConfigurationElement ^ element, System::String ^ elementName, System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected:
virtual bool ShouldSerializeElementInTargetVersion(System::Configuration::ConfigurationElement ^ element, System::String ^ elementName, System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected internal virtual bool ShouldSerializeElementInTargetVersion(System.Configuration.ConfigurationElement element, string elementName, System.Runtime.Versioning.FrameworkName targetFramework);
protected virtual bool ShouldSerializeElementInTargetVersion(System.Configuration.ConfigurationElement element, string elementName, System.Runtime.Versioning.FrameworkName targetFramework);
abstract member ShouldSerializeElementInTargetVersion : System.Configuration.ConfigurationElement * string * System.Runtime.Versioning.FrameworkName -> bool
override this.ShouldSerializeElementInTargetVersion : System.Configuration.ConfigurationElement * string * System.Runtime.Versioning.FrameworkName -> bool
Protected Friend Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean
Protected Overridable Function ShouldSerializeElementInTargetVersion (element As ConfigurationElement, elementName As String, targetFramework As FrameworkName) As Boolean
Parámetros
- element
- ConfigurationElement
Objeto ConfigurationElement que es un candidato para la serialización.
- elementName
- String
Nombre del ConfigurationElement objeto tal y como se produce en XML.
- targetFramework
- FrameworkName
Versión de destino de .NET Framework.
Devoluciones
true
element 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 el elemento especificado es válido 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, de forma predeterminada se serializarán todos los elementos de configuración contenidos en la sección de configuración para todas las versiones del marco.