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
属性
实现

注解

DesignSurfaceManager 类旨在成为 DesignSurface 对象的容器。The 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. 您可以通过在 "受保护的 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 使用的非托管资源,并选择性地释放托管资源。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 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。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:

适用于

另请参阅