ConfigurationSection.ShouldSerializeSectionInTargetVersion 方法

定義

指示當前ConfigurationSection實例是否應該序列化,當配置物件階層序列化以符合指定目標版本.NET框架時。

protected public:
 virtual bool ShouldSerializeSectionInTargetVersion(System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected:
 virtual bool ShouldSerializeSectionInTargetVersion(System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected internal virtual bool ShouldSerializeSectionInTargetVersion(System.Runtime.Versioning.FrameworkName targetFramework);
protected virtual bool ShouldSerializeSectionInTargetVersion(System.Runtime.Versioning.FrameworkName targetFramework);
abstract member ShouldSerializeSectionInTargetVersion : System.Runtime.Versioning.FrameworkName -> bool
override this.ShouldSerializeSectionInTargetVersion : System.Runtime.Versioning.FrameworkName -> bool
Protected Friend Overridable Function ShouldSerializeSectionInTargetVersion (targetFramework As FrameworkName) As Boolean
Protected Overridable Function ShouldSerializeSectionInTargetVersion (targetFramework As FrameworkName) As Boolean

參數

targetFramework
FrameworkName

目標版本的 .NET 框架。

傳回

true是否應該將當前區段進行序列化;否則,。 false

備註

每個為 .NET Framework 4 及以後版本建立的設定區段,必須明確覆寫此方法並回傳 true,但前提是該配置區段適用於指定的 .NET 框架版本。 為早期版本 .NET Framework 建立的現有設定區塊無需更改。

基底型態包含此方法的預設實作,且總是回傳 true。 如果你實作設定區段且沒有覆蓋此方法,預設情況下該組態區段會對所有框架版本序列化。

適用於