ConfigurationSectionGroup.ShouldSerializeSectionGroupInTargetVersion 方法

定義

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

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

參數

targetFramework
FrameworkName

目標版本的 .NET 框架。

傳回

true如果目前的區段群組應該被序列化;否則,。 false

備註

每個為 .NET Framework 4 及更新版本建立的配置區段群組,必須明確覆寫此方法並回傳 true,但前提是該區段群對指定版本的 .NET 框架有效。 為早期版本 .NET Framework 建立的現有組態區群組無需更改。

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

適用於