RefreshPropertiesAttribute 類別

定義

指出屬性方格應該在關聯的屬性值變更時重新整理。Indicates that the property grid should refresh when the associated property value changes. 此類別無法獲得繼承。This class cannot be inherited.

public ref class RefreshPropertiesAttribute sealed : Attribute
public sealed class RefreshPropertiesAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.All)]
public sealed class RefreshPropertiesAttribute : Attribute
type RefreshPropertiesAttribute = class
    inherit Attribute
Public NotInheritable Class RefreshPropertiesAttribute
Inherits Attribute
繼承
RefreshPropertiesAttribute
屬性

範例

下列程式碼範例將示範如何使用 RefreshPropertiesAttribute 類別來指定 DataSource 屬性的重新整理模式。The following code example demonstrates using the RefreshPropertiesAttribute class to specify the refresh mode for a DataSource property. 如需完整的程式代碼清單,請參閱如何:在 Windows Forms 控制項中套用屬性For a full code listing, see How to: Apply Attributes in Windows Forms Controls.

[Category("Data")]
[Description("Indicates the source of data for the control.")]
[RefreshProperties(RefreshProperties.Repaint)]
[AttributeProvider(typeof(IListSource))]
public object DataSource
{
    get
    {
        return this.dataGridView1.DataSource;
    }

    set
    {
        this.dataGridView1.DataSource = value;
    }
}
<Category("Data"), _
Description("Indicates the source of data for the control."), _
RefreshProperties(RefreshProperties.Repaint), _
AttributeProvider(GetType(IListSource))> _
Public Property DataSource() As Object
    Get
        Return Me.dataGridView1.DataSource
    End Get

    Set(ByVal value As Object)
        Me.dataGridView1.DataSource = value
    End Set
End Property

備註

RefreshPropertiesAttribute 表示重新整理 PropertyGrid 控制項時要使用的重新整理模式類型。The RefreshPropertiesAttribute indicates the type of refresh mode to use when refreshing a PropertyGrid control.

建構函式

RefreshPropertiesAttribute(RefreshProperties)

初始化 RefreshPropertiesAttribute 類別的新執行個體。Initializes a new instance of the RefreshPropertiesAttribute class.

欄位

All

表示屬性值有任何變動時,需查詢並重新整理所有屬性。Indicates that all properties are queried again and refreshed if the property value is changed. 此欄位為唯讀。This field is read-only.

Default

指示如果變更屬性值,不需重新整理其他屬性。Indicates that no other properties are refreshed if the property value is changed. 此欄位為唯讀。This field is read-only.

Repaint

指示如果屬性值變更,所有屬性都會重新繪製。Indicates that all properties are repainted if the property value is changed. 此欄位為唯讀。This field is read-only.

屬性

RefreshProperties

取得成員的重新整理屬性。Gets the refresh properties for the member.

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。When implemented in a derived class, gets a unique identifier for this Attribute.

(繼承來源 Attribute)

方法

Equals(Object)

覆寫此物件的 Equals 方法。Overrides the object's Equals method.

GetHashCode()

傳回這個物件的雜湊程式碼。Returns the hash code for this object.

GetType()

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

(繼承來源 Object)
IsDefaultAttribute()

取得值,指出目前屬性值是否為屬性的預設值。Gets a value indicating whether the current value of the attribute is the default value for the attribute.

Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(繼承來源 Attribute)
MemberwiseClone()

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

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

明確介面實作

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can be used to get the type information for an interface.

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

(繼承來源 Attribute)

適用於

另請參閱