OfficeExtension.EventHandlers class
Constructors
(constructor)(context, parent |
Constructs a new instance of the |
Methods
add(handler) | Adds a function to be called when the event is triggered. |
remove(handler) | Removes the specified function from the event handler list so that it will not be called on subsequent events. Note: The same RequestContext object that the handler was added in must be used when removing the handler. More information can be found in Remove an event handler. |
Constructor Details
(constructor)(context, parentObject, name, eventInfo)
Constructs a new instance of the EventHandlers
class
constructor(context: ClientRequestContext, parentObject: ClientObject, name: string, eventInfo: EventInfo<T>);
Parameters
- parentObject
- OfficeExtension.ClientObject
- name
-
string
- eventInfo
Method Details
add(handler)
Adds a function to be called when the event is triggered.
add(handler: (args: T) => Promise<any>): EventHandlerResult<T>;
Parameters
- handler
-
(args: T) => Promise<any>
A promise-based function that takes in any relevant event arguments.
Returns
remove(handler)
Removes the specified function from the event handler list so that it will not be called on subsequent events.
Note: The same RequestContext object that the handler was added in must be used when removing the handler. More information can be found in Remove an event handler.
remove(handler: (args: T) => Promise<any>): void;
Parameters
- handler
-
(args: T) => Promise<any>
A reference to a function previously provided to the add
method as an event handler.
Returns
void
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per