ConfigurationSection.ShouldSerializePropertyInTargetVersion Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Wskazuje, czy określona właściwość powinna być serializowana, gdy hierarchia obiektów konfiguracji jest serializowana dla określonej wersji docelowej programu .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
Parametry
- property
- ConfigurationProperty
ConfigurationProperty Obiekt, który jest kandydatem do serializacji.
- propertyName
- String
Nazwa ConfigurationProperty obiektu w formacie XML.
- targetFramework
- FrameworkName
Docelowa wersja platformy .NET Framework.
- parentConfigurationElement
- ConfigurationElement
Element nadrzędny właściwości.
Zwraca
true
property jeśli element powinien być serializowany; w przeciwnym razie false.
Uwagi
Każda sekcja konfiguracji utworzona dla programu .NET Framework 4 i nowszych wersji musi jawnie zastąpić tę metodę i zwrócić true, ale tylko wtedy, gdy określona właściwość jest prawidłowa dla określonej wersji programu .NET Framework. Nie trzeba zmieniać istniejących sekcji konfiguracji utworzonych dla wcześniejszych wersji programu .NET Framework.
Typ podstawowy zawiera domyślną implementację tej metody, która zawsze zwraca wartość true. Jeśli zaimplementujesz sekcję konfiguracji i nie zastąpisz tej metody, domyślnie wszystkie właściwości konfiguracji zawarte w sekcji konfiguracji będą serializowane dla wszystkich wersji platformy.