TemplateModeChangedEventArgs 类
定义
public ref class TemplateModeChangedEventArgs : EventArgs
public class TemplateModeChangedEventArgs : EventArgs
type TemplateModeChangedEventArgs = class
inherit EventArgs
Public Class TemplateModeChangedEventArgs
Inherits EventArgs
- 继承
注解
此 ViewEvent 事件由设计器宿主(如 Visual Studio 2005)为设计图面上某个控件上的某些操作引发。The ViewEvent event is raised by a designer host, such as Visual Studio 2005, for certain actions on a control on the design surface. 例如,当你进入或退出控件的模板编辑模式时,将引发事件。For example, an event is raised when you enter or exit template editing mode for a control.
ControlDesigner类提供用于处理事件的默认委托 ViewEvent 。The ControlDesigner class supplies a default delegate to handle the ViewEvent event. 退出或进入模板编辑模式时,设计器宿主将初始化 ViewEventArgs 事件类型的对象 TemplateModeChanged ,然后 EventArgs 使用对象设置该属性 TemplateModeChangedEventArgs 。When you exit or enter template editing mode, the designer host initializes a ViewEventArgs object for a TemplateModeChanged event type, and then sets the EventArgs property with a TemplateModeChangedEventArgs object.
当 ViewEventArgs 对象指示模板模式已更改时,类中的默认委托将 ControlDesigner 更新属性的值 InTemplateMode 。When the ViewEventArgs object indicates that the template mode has changed, the default delegate in the ControlDesigner class updates the value for the InTemplateMode property.
从类派生的自定义设计器 TemplatedControlDesigner 可以重写 OnTemplateModeChanged 方法,以便在设计图面上的控件的模板编辑模式更改时执行附加处理。Custom designers that are derived from the TemplatedControlDesigner class can override the OnTemplateModeChanged method to perform additional processing when the template editing mode changes for a control on the design surface.
有关事件和委托的详细信息,请参阅 处理和引发事件。For more information about events and delegates, see Handling and Raising Events.
构造函数
| TemplateModeChangedEventArgs(TemplateGroup) |
使用指定的模板组初始化 TemplateModeChangedEventArgs 类的新实例。Initializes a new instance of the TemplateModeChangedEventArgs class with the specified template group. |
属性
| NewTemplateGroup |
获取进入模板编辑模式时创建的模板组。Gets the template group that was created when you entered template editing mode. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |