Component 類別

定義

提供 IComponent 介面的基底實作,並啟用應用程式之間的物件共用。

public ref class Component : MarshalByRefObject, IDisposable, System::ComponentModel::IComponent
public ref class Component : MarshalByRefObject, System::ComponentModel::IComponent
public class Component : MarshalByRefObject, IDisposable, System.ComponentModel.IComponent
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class Component : MarshalByRefObject, IDisposable, System.ComponentModel.IComponent
public class Component : MarshalByRefObject, System.ComponentModel.IComponent
type Component = class
    inherit MarshalByRefObject
    interface IComponent
    interface IDisposable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Component = class
    inherit MarshalByRefObject
    interface IComponent
    interface IDisposable
Public Class Component
Inherits MarshalByRefObject
Implements IComponent, IDisposable
Public Class Component
Inherits MarshalByRefObject
Implements IComponent
繼承
衍生
屬性
實作

備註

Component 是 Common Language Runtime 中以傳址方式封送處理之所有元件的基類。 Component 是可遠端的,而且衍生自 MarshalByRefObject 類別。 Component 提供 介面的實作 IComponent 。 提供 MarshalByValueComponent 以傳值方式封送處理的 實 IComponent 作。

您可以在任何實作 IContainer 介面的物件中裝載 Component ,而且您可以從其容器查詢和取得服務。 容器會 ISite 為其包含的每個 Component 建立 。 容器會使用月臺來管理 , Component 並由 Component 用來與其容器通訊。

Component應該透過呼叫其 Dispose 方法明確釋放資源,而不需透過隱含呼叫 Finalize 方法來等候自動記憶體管理。 Container處置 時,也會處置 中的所有 Container 元件。

建構函式

Component()

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

屬性

CanRaiseEvents

取得值,指出元件是否能引發事件。

Container

取得包含 IContainerComponent

DesignMode

取得值,指出 Component 目前是否處於設計模式。

Events

取得附加在這個 Component 上的事件處理常式清單。

Site

取得或設定 ComponentISite

方法

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

(繼承來源 MarshalByRefObject)
Dispose()

釋放 Component 所使用的所有資源。

Dispose(Boolean)

釋放 Component 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
Finalize()

釋出 Unmanaged 資源並執行其他清除作業後,記憶體回收才能重新回收 Component

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetLifetimeService()
已淘汰.

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。

(繼承來源 MarshalByRefObject)
GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
InitializeLifetimeService()
已淘汰.

取得存留期服務物件,以控制這個執行個體的存留期原則。

(繼承來源 MarshalByRefObject)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。

(繼承來源 MarshalByRefObject)
ToString()

傳回任何包含 Component 名稱的 String。 不應覆寫此方法。

事件

Disposed

Dispose() 方法的呼叫處置元件時,就會發生。

適用於

另請參閱