ICustomFactory 介面

定義

允許使用者撰寫擴充 MarshalByRefObject 的 Managed 物件的啟動程式碼。Enables users to write activation code for managed objects that extend MarshalByRefObject.

public interface class ICustomFactory
[System.Runtime.InteropServices.ComVisible(true)]
public interface ICustomFactory
type ICustomFactory = interface
Public Interface ICustomFactory
屬性

備註

您可以提供一個 proxy 類別來執行 ICustomFactory,並將 MarshalByRefObject 類別的使用 ProxyAttribute,以啟用自訂啟動。You can enable custom activation by providing a proxy class that implements ICustomFactory and attributing the MarshalByRefObject class with the ProxyAttribute. 當類別啟動時,會由 common language runtime 呼叫 proxy 的 CreateInstance 方法來啟用類別。When the class is activated, the proxy's CreateInstance method is called by the common language runtime to activate the class.

方法

CreateInstance(Type)

建立指定類型的新執行個體。Creates a new instance of the specified type.

適用於