RefreshPropertiesAttribute 類別

定義

指出屬性方格應該在關聯的屬性值變更時重新整理。 此類別無法獲得繼承。

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

範例

下列程式代碼範例示範如何使用 RefreshPropertiesAttribute 類別來指定屬性的 DataSource 重新整理模式。 如需完整的程式代碼清單,請參閱如何:在 Windows Forms 控件中套用屬性

[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 模式類型。

建構函式

RefreshPropertiesAttribute(RefreshProperties)

初始化 RefreshPropertiesAttribute 類別的新執行個體。

欄位

All

表示屬性值有任何變動時,需查詢並重新整理所有屬性。 此欄位為唯讀。

Default

指示如果變更屬性值,不需重新整理其他屬性。 此欄位為唯讀。

Repaint

指示如果屬性值變更,所有屬性都會重新繪製。 此欄位為唯讀。

屬性

RefreshProperties

取得成員的重新整理屬性。

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)

方法

Equals(Object)

覆寫此物件的 Equals 方法。

GetHashCode()

傳回此物件的雜湊碼。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

取得值,指出目前屬性值是否為屬性的預設值。

IsDefaultAttribute()

在衍生類別中覆寫時,表示這個執行個體的值是衍生類別的預設值。

(繼承來源 Attribute)
Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

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

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

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

擷取物件的類型資訊,可以用來取得介面的類型資訊。

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

擷取物件提供的類型資訊介面數目 (0 或 1)。

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

提供物件所公開的屬性和方法的存取權。

(繼承來源 Attribute)

適用於

另請參閱