ComEventInterfaceAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
ComEventInterfaceAttribute may be unavailable in future releases.
識別來源介面和類別,這個類別會實作從 COM 類型連結庫匯入 coclass 時所產生的事件介面方法。
public ref class ComEventInterfaceAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)]
[System.Obsolete("ComEventInterfaceAttribute may be unavailable in future releases.")]
public sealed class ComEventInterfaceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)]
public sealed class ComEventInterfaceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ComEventInterfaceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)>]
[<System.Obsolete("ComEventInterfaceAttribute may be unavailable in future releases.")>]
type ComEventInterfaceAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)>]
type ComEventInterfaceAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Interface, Inherited=false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type ComEventInterfaceAttribute = class
inherit Attribute
Public NotInheritable Class ComEventInterfaceAttribute
Inherits Attribute
- 繼承
- 屬性
備註
你可以將此屬性套用到介面上,雖然Tlbimp.exe( 型別庫匯入器 )通常在匯入型別庫時會幫你套用。
當原始碼介面從型別函式庫匯入時,該介面所實作的任何方法都會被加入產生的事件介面事件中。 Tlbimp.exe 應用 ComEventInterfaceAttribute 於事件介面,以識別實作事件介面方法及原始原始碼介面的受管理類別。 通用語言執行時在執行時會使用此屬性執行以下任務:
- 將介面中暴露的事件與其在事件提供者類別中的實作關聯起來。
- 將事件連結到原始的 COM 原始碼介面。
你很少會用這個屬性。 然而,如果你打算撰寫能產生與 Tlbimp.exe產生的元資料密切相關的元資料的原始碼,你應該為每個原始原始碼介面建立一個事件介面。
建構函式
| 名稱 | Description |
|---|---|
| ComEventInterfaceAttribute(Type, Type) |
已淘汰.
初始化一個新的類別實例 ComEventInterfaceAttribute ,使用原始介面與事件提供者類別。 |
屬性
| 名稱 | Description |
|---|---|
| EventProvider |
已淘汰.
取得實作事件介面方法的類別。 |
| SourceInterface |
已淘汰.
從型別庫取得原始原始碼介面。 |
| TypeId |
已淘汰.
在衍生類別中實作時,取得這個 Attribute的唯一標識碼。 (繼承來源 Attribute) |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
已淘汰.
傳回值,這個值表示這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| GetHashCode() |
已淘汰.
傳回這個實例的哈希碼。 (繼承來源 Attribute) |
| GetType() |
已淘汰.
取得目前實例的 Type。 (繼承來源 Object) |
| IsDefaultAttribute() |
已淘汰.
在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。 (繼承來源 Attribute) |
| Match(Object) |
已淘汰.
在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| MemberwiseClone() |
已淘汰.
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
已淘汰.
傳回表示目前 物件的字串。 (繼承來源 Object) |
明確介面實作
| 名稱 | Description |
|---|---|
| _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) |