DesignSurfaceManager 類別

定義

管理 DesignSurface 物件的集合。Manages a collection of DesignSurface objects.

public ref class DesignSurfaceManager : IDisposable, IServiceProvider
[System.Security.SecurityCritical]
public class DesignSurfaceManager : IDisposable, IServiceProvider
type DesignSurfaceManager = class
    interface IServiceProvider
    interface IDisposable
Public Class DesignSurfaceManager
Implements IDisposable, IServiceProvider
繼承
DesignSurfaceManager
屬性
實作

備註

類別是設計成物件的DesignSurface容器。 DesignSurfaceManagerThe DesignSurfaceManager class is designed to be a container of DesignSurface objects. 它提供處理設計工具、屬性視窗和其他全域物件之間事件路由的泛型服務。It provides common services that handle event routing between designers, property windows, and other global objects. 使用DesignSurfaceManager是選擇性的, 但如果您想要有數個設計工具視窗, 建議您使用此選項。Using DesignSurfaceManager is optional, but it is recommended if you intend to have several designer windows.

DesignSurfaceManager類別會自動提供數個設計階段服務。The DesignSurfaceManager class provides several design-time services automatically. 您可以藉由在 protected ServiceContainer屬性中取代這些服務, 來覆寫這些服務。You can override each of these services by replacing them in the protected ServiceContainer property. 若要取代服務, 請覆寫此函式、呼叫基底, 然後透過 protected ServiceContainer屬性進行任何變更。To replace a service, override the constructor, call base, and make any changes through the protected ServiceContainer property. 當處置設計IDisposable介面管理員時, 會處置所有新增至服務容器的所有服務, 以執行介面。All services added to the service container that implement the IDisposable interface are disposed when the design surface manager is disposed. DesignSurfaceManager類別會IDesignerEventService提供介面做為預設服務。The DesignSurfaceManager class provides the IDesignerEventService interface as the default service. IDesignerEventService為設計工具事件提供全域事件機制。IDesignerEventService provides a global eventing mechanism for designer events. 使用這種機制時, 應用程式會在設計工具變成使用中時收到通知。With this mechanism, an application is informed when a designer becomes active. 服務會提供設計工具集合和單一位置, 其中的全域物件 (例如屬性視窗) 可以監視選取的變更事件。The service provides a collection of designers and a single place where global objects, such as the Properties window, can monitor selection change events.

建構函式

DesignSurfaceManager()

初始化 DesignSurfaceManager 類別的新執行個體。Initializes a new instance of the DesignSurfaceManager class.

DesignSurfaceManager(IServiceProvider)

初始化 DesignSurfaceManager 類別的新執行個體。Initializes a new instance of the DesignSurfaceManager class.

屬性

ActiveDesignSurface

取得或設定使用中的設計工具。Gets or sets the active designer.

DesignSurfaces

取得設計介面的集合。Gets a collection of design surfaces.

ServiceContainer

取得設計介面管理員的 ServiceContainerGets the design surface manager's ServiceContainer.

方法

CreateDesignSurface()

建立設計介面的執行個體。Creates an instance of a design surface.

CreateDesignSurface(IServiceProvider)

建立設計介面的執行個體。Creates an instance of a design surface.

CreateDesignSurfaceCore(IServiceProvider)

建立設計介面的實作。Implementation that creates the design surface.

Dispose()

釋放 DesignSurfaceManager 使用的資源。Releases the resources used by the DesignSurfaceManager.

Dispose(Boolean)

釋放 DesignSurfaceManager 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DesignSurfaceManager and optionally releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetService(Type)

取得設計介面管理員服務容器中的服務。Gets a service in the design surface manager's service container.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

事件

ActiveDesignSurfaceChanged

發生於目前使用中的設計工具變更時。Occurs when the currently active designer changes.

DesignSurfaceCreated

發生於設計工具建立時。Occurs when a designer is created.

DesignSurfaceDisposed

發生於處置設計工具時。Occurs when a designer is disposed.

SelectionChanged

發生於全域選取變更時。Occurs when the global selection changes.

安全性

NamedPermissionSet
以取得系統資源的完整存取權。for full access to system resources. 需求值: LinkDemandInheritanceDemandDemand values: LinkDemand, InheritanceDemand. 相關聯的狀態:Associated state:

適用於

另請參閱