DesignSurface 建構函式

定義

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

多載

DesignSurface()

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

DesignSurface(IServiceProvider)

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

DesignSurface(Type)

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

DesignSurface(IServiceProvider, Type)

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

DesignSurface()

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

public:
 DesignSurface();
public DesignSurface ();
Public Sub New ()

例外狀況

附加至 DesignSurfaceIDesignerHost 已經過處置。

適用於

DesignSurface(IServiceProvider)

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

public:
 DesignSurface(IServiceProvider ^ parentProvider);
public DesignSurface (IServiceProvider parentProvider);
public DesignSurface (IServiceProvider? parentProvider);
new System.ComponentModel.Design.DesignSurface : IServiceProvider -> System.ComponentModel.Design.DesignSurface
Public Sub New (parentProvider As IServiceProvider)

參數

parentProvider
IServiceProvider

父服務提供者,如果未使用父代解析服務,則為 null

例外狀況

附加至 DesignSurfaceIDesignerHost 已經過處置。

備註

出現時 parentProvide ,介面中包含的設計工具可以從應用程式擷取服務。

另請參閱

適用於

DesignSurface(Type)

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

public:
 DesignSurface(Type ^ rootComponentType);
public DesignSurface (Type rootComponentType);
new System.ComponentModel.Design.DesignSurface : Type -> System.ComponentModel.Design.DesignSurface
Public Sub New (rootComponentType As Type)

參數

rootComponentType
Type

要建立的根元件型別。

例外狀況

rootComponentnull

附加至 DesignSurfaceIDesignerHost 已經過處置。

備註

當您使用 建構函式時 DesignSurface ,它會建立簡單的設計工具載入器,然後建立指定類型的元件,然後結束載入程式。 這是建立設計工具的簡單方式,假設所有儲存狀態都會在外部完成。 在內部,這會呼叫 BeginLoad 並傳遞根元件類型。

注意

DesignSurface 載不受影響 DesignerOptionsDesignerOptions在設計介面載入之前,必須在服務容器中。 如果您需要存取 DesignerOptions,請呼叫空的建構函式,將 新增DesignerOptions至 ,ServiceContainer並使用 呼叫 rootComponentTypeBeginLoad

適用於

DesignSurface(IServiceProvider, Type)

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

public:
 DesignSurface(IServiceProvider ^ parentProvider, Type ^ rootComponentType);
public DesignSurface (IServiceProvider parentProvider, Type rootComponentType);
public DesignSurface (IServiceProvider? parentProvider, Type rootComponentType);
new System.ComponentModel.Design.DesignSurface : IServiceProvider * Type -> System.ComponentModel.Design.DesignSurface
Public Sub New (parentProvider As IServiceProvider, rootComponentType As Type)

參數

parentProvider
IServiceProvider

父服務提供者,如果未使用父代解析服務,則為 null

rootComponentType
Type

要建立的根元件型別。

例外狀況

rootComponentnull

附加至 DesignSurfaceIDesignerHost 已經過處置。

備註

使用 建 DesignSurface 構函式會建立簡單的設計工具載入器,以建立指定類型的元件,然後結束載入程式。 這是建立設計工具的簡單方式,假設所有儲存狀態都會在外部完成。 在內部,這會呼叫 BeginLoad 並傳遞根元件類型。

另請參閱

適用於