Bagikan melalui


ConfigurationSection.ShouldSerializePropertyInTargetVersion Metode

Definisi

Menunjukkan apakah properti yang ditentukan harus diserialisasikan ketika hierarki objek konfigurasi diserialisasikan untuk versi target yang ditentukan dari .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

Parameter

property
ConfigurationProperty

Objek ConfigurationProperty yang merupakan kandidat untuk serialisasi.

propertyName
String

Nama objek seperti yang ConfigurationProperty terjadi di XML.

targetFramework
FrameworkName

Versi target .NET Framework.

parentConfigurationElement
ConfigurationElement

Elemen induk properti.

Mengembalikan

true jika harus diserialisasikan property ; jika tidak, false.

Keterangan

Setiap bagian konfigurasi yang dibuat untuk .NET Framework 4 dan versi yang lebih baru harus secara eksplisit mengambil alih metode ini dan mengembalikan true, tetapi hanya jika properti yang ditentukan valid untuk versi .NET Framework yang ditentukan. Bagian konfigurasi yang ada yang dibuat untuk versi .NET Framework yang lebih lama tidak perlu diubah.

Jenis dasar berisi implementasi default metode ini yang selalu mengembalikan true. Jika Anda menerapkan bagian konfigurasi dan Anda tidak mengambil alih metode ini, secara default semua properti konfigurasi yang terkandung di bagian konfigurasi akan diserialisasikan untuk semua versi kerangka kerja.

Berlaku untuk