SettingsProperty 類別

定義

在內部會當做類別使用,此類別表示與個別組態屬性有關的中繼資料。Used internally as the class that represents metadata about an individual configuration property.

public ref class SettingsProperty
public class SettingsProperty
type SettingsProperty = class
Public Class SettingsProperty
繼承
SettingsProperty

備註

SettingsProperty 用來描述衍生自之類別的設定屬性 SettingsBaseSettingsProperty is used to describe settings properties of a class derived from SettingsBase. 設定 API 允許將設定屬性集合組成 common language runtime 類別。The Settings API allows a collection of settings properties to be grouped into a common language runtime class.

保存設定時, SettingsBase 基類會要求物件的集合,這些 SettingsProperty 物件會以型別的集合分組 SettingsPropertyCollectionWhen persisting settings, the SettingsBase base class asks for a collection of SettingsProperty objects, grouped in a collection of type SettingsPropertyCollection. 它會藉由呼叫本身的屬性成員來執行此工作。It does this by calling its own Properties member. 繼承的類別應該會傳回要保存之屬性的集合。Inherited classes should return a collection of properties to persist.

每個 SettingsProperty 物件都包含屬性的相關中繼資料,包括下列各項:Each SettingsProperty object includes metadata about the property, including the following:

  • Name:Name.

  • 預設值。Default value.

  • 屬性類型。Property type.

  • 序列化方法。Serialization method.

  • 要用於持續性的提供者。Provider to use for persistence.

  • 其他內容與提供者特定的任意屬性。Other arbitrary attributes that are context and provider specific.

建構函式

SettingsProperty(SettingsProperty)

根據提供的參數,初始化 SettingsProperty 類別的新執行個體。Initializes a new instance of the SettingsProperty class, based on the supplied parameter.

SettingsProperty(String)

初始化 SettingsProperty 類別的新執行個體。Initializes a new instance of the SettingsProperty class. 以提供的參數為基礎。based on the supplied parameter.

SettingsProperty(String, Type, SettingsProvider, Boolean, Object, SettingsSerializeAs, SettingsAttributeDictionary, Boolean, Boolean)

根據提供的參數,建立 SettingsProperty 類別的新執行個體。Creates a new instance of the SettingsProperty class based on the supplied parameters.

屬性

Attributes

取得 SettingsAttributeDictionary 物件,其中包含 SettingsProperty 物件的屬性。Gets a SettingsAttributeDictionary object containing the attributes of the SettingsProperty object.

DefaultValue

取得或設定 SettingsProperty 物件的預設值。Gets or sets the default value of the SettingsProperty object.

IsReadOnly

取得或設定值,指定 SettingsProperty 物件是否為唯讀。Gets or sets a value specifying whether a SettingsProperty object is read-only.

Name

取得或設定 SettingsProperty 的名稱。Gets or sets the name of the SettingsProperty.

PropertyType

取得或設定 SettingsProperty 的型別。Gets or sets the type for the SettingsProperty.

Provider

取得或設定 SettingsProperty 的提供者。Gets or sets the provider for the SettingsProperty.

SerializeAs

取得或設定 SettingsSerializeAsSettingsProperty 物件。Gets or sets a SettingsSerializeAs object for the SettingsProperty.

ThrowOnErrorDeserializing

取得或設定值,指定在屬性的還原序列化未能成功時,是否會擲回錯誤。Gets or sets a value specifying whether an error will be thrown when the property is unsuccessfully deserialized.

ThrowOnErrorSerializing

取得或設定值,指定在屬性的序列化未能成功時,是否會擲回錯誤。Gets or sets a value specifying whether an error will be thrown when the property is unsuccessfully serialized.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於