ScriptComponentDescriptor.AddEvent(String, String) 方法

定义

添加指定的事件和处理程序。Adds the specified event and handler.

public:
 void AddEvent(System::String ^ name, System::String ^ handler);
public void AddEvent (string name, string handler);
member this.AddEvent : string * string -> unit
Public Sub AddEvent (name As String, handler As String)

参数

name
String

事件的名称。The name of the event.

handler
String

指定事件的处理程序函数的名称。The name of the handler function for the specified event.

例外

namehandlernull 或空字符串 ("")。name or handler is null or an empty string ("").

注解

此方法将事件和处理程序添加到由GetScript方法转换为客户端脚本的事件的内部字典。This method adds the event and handler to the internal dictionary of events that are converted to client script by the GetScript method.

适用于