Skip to main content

Events

ICommandsEvents

Ths ICommandEvents interface provides methods to register and unregister event handlers for custom commands:

  • Register( event, callback ): Registers an event handler for the specified event and returns the event handler ID.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.

The ICommands interface has Events property, which provides access to the ICommandsEvents interface.

Here is a JavaScript example of how to use the ICommandsEvents interface to listen for custom command events and their data:

const commandsEvents = shellFrame.Commands.Events;
// Register event handler for the custom command
const eventId = await commandsEvents.Register(
Event.CustomCommand,
(commandID, data) => {
console.log("Custom command invoked: ", commandID);
console.log("Data: ", data);
},
);
EventDescriptionArguments
CustomCommandTriggered when a custom command is invoked.commandID The ID of the custom command to be used.
data The data passed to the custom command.
BuiltinCommandCallback handler for Builtin commands.commandId The ID of the built-in command to be used.
param Some of the commands use parameters. For instance, when the dialog for creating a new object is shown, the object type ID is defined here.

IDashboardEvents

The IDashboard interface has Events property, which provides access to the IDashboardEvents interface. This interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event and returns the event handler ID.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.

One of the use cases for events in IDashboard is to listen for custom data changes provided by UpdateCustomData method.

Here is a JavaScript example of how to use the IDashboardEvents interface to listen for custom data changes using globally defined events.

// Register event handler for the custom data changes.
const eventId = await dashboard.Events.Register(
MFiles.Event.CustomDataChanged,
(data) => {
console.log("Custom data changed: ", data);
},
);
EventDescriptionArguments
RefreshTriggered when the Dashboard data is refreshed.
StartedSent when the Dashboard turns to started state.
StopSent before the Dashboard is stopped.
CustomDataChangedThis event is triggered, when custom data on dashboard has changed. The event can be
used to update the dashboard based on the new data. This event will fire at least
once when the dashboard is started and initialized.
data New custom data for the dashboard

ISearchPaneEvents

Interface for the Search pane events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StopSent before the Searchpane is closed.
StartedRegisters event handler for the Search pane started event, which means that the Search pane
is ready to be used.

IShellFrameEvents

IShellFrameEvents interface provides means to manage shell frame events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StopSent before the IShellFrame is stopped.
StartedRegisters event handler for the IShellFrame started event, which means that the IShellFrame
is ready to be used. This event will trigger at least once for each registered callback
if the IShellFrame is already started and not yet stopped.
ViewLocationChangedRegisters event handler for the IShellFrame ViewLocationChanged event, which means that the view location has changed.
ViewLocationChangedAsyncRegisters event handler for the IShellFrame ViewLocationChangedAsync event, which means that the view location has changed.
NewCommandsRegisters event handler for the IShellFrame NewCommands event, which means that a new ICommands interface has been created and is ready to be used.
NewRightPaneRegisters event handler for the IShellFrame NewRightPane event, which means that a shell pane container is created for right shell pane.
NewShellListingRegisters event handler for the IShellFrame NewShellListing event, which means that a new shell listing object is created.newShellisting The new IShellListing object.

IShellListingEvents

IShellListingEvents interface provides means to manage shell listing events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StartedRegisters event handler for the IShellListingEvents started event.
StopRegisters event handler for the IShellListingEvents stopped event.
SelectionChangedRegisters event handler for the IShellListingEvents SelectionChanged event.
This event is triggered when the selection in the listing view is set, changed or removed.
shellItems Contains the selected items.
SelectNextObjectRegisters event handler for the IShellListingEvents SelectNextObject event. This event is triggered when the next object in the listing is selected.
SelectPreviousObjectRegisters event handler for the IShellListingEvents SelectPreviousObject event. This event is triggered when the previous object in the listing is selected.
SelectNextFolderRegisters event handler for the IShellListingEvents SelectNextFolder event. This event is triggered when the next folder in the listing is selected.folderType type of the folder, which have been selected.
SelectPreviousFolderRegisters event handler for the IShellListingEvents SelectPreviousFolder event. This event is triggered when the previous folder in the listing is selected.folderType type of the folder, which have been selected.
ListingDeactivatedRegisters event handler for the IShellListingEvents ListingDeactivated event.
This event is triggered when the listing object becomes inactive and loses the input focus.
shellListing The next active shell listing object. Can be null.
ListingActivatedRegisters event handler for the IShellListingEvents ListingActivated event.
This event is triggered when the listing object becomes active and receives the input focus.
shellListing The previous active shell listing object. Can be null.
ContentChangedRegisters event handler for the IShellListingEvents ContentChanged event.
This event is triggered when the current listing content is changed, or listed items are modified.
shellItems Contains all items in the listing.
ListItemAddedRegisters event handler for the IShellListingEvents ListItemAdded event. This event is triggered when one or more items are added to the listing.objectVersion Object
ListItemRemovedRegisters event handler for the IShellListingEvents ListItemRemoved event. This event is triggered when one or more items are removed from the listing.listItem Either an array of ObjectVersionEx if non-folder objects are removed or a single ObjectVersionEx, in case folder is removed.
removedExternalFolder In case folder was removed, include information about the old external folder item being removed in case of
ListItemModifiedRegisters event handler for the IShellListingEvents ListItemModified event.
This event is triggered when one or more of the items that are currently selected are modified.
oldServerObjVer Array of old object versions.
newObjVer Array of new objects.
SelectedItemsChangedRegisters event handler for the IShellListingEvents SelectedItemsChanged event.
This event is triggered when one or more of the items that are currently selected are modified.
shellItems Contains the selected items.

IShellPaneTabEvents

Interface for the Shell pane tab events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StartedSent when the object turns to started state.
StopSent before the object is stopped.

IShellPaneContainerEvents

Interface for the Shell pane container events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StopSent when the object turns to stopped state.
StartedSent when the object turns to started state.

IShellUIEvents

Interface for the Shell UI events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
StartedSent when the object turns to started state.
StopRegister event to listen for the stop event.
NewShellFrameRegister event handler for the NewShellFrame event. This event is triggered when any shell frame object is created,
including normal shell frames, common dialogs, and embedded or special shell frames.
shellFrame
NewNormalShellFrameRegister event handler for the NewNormalShellFrame event. This event is triggered when a normal shell frame object is created.
Note that this event is not triggered for common dialogs, or embedded or special shell frames.
shellFrame The new shell frame object.
CrossApplicationNotificationBroadcasted message to multiple applications.appGUID GUID of the target application, or null if broadcasted to all applications
msgId ID of the message which is sent to the other applications.
data Custom data to be sent.

IWindowEvents

Interface for the Window events. The interface provides two methods:

  • Register( event, callback ): Registers an event handler for the specified event.
  • Unregister( eventId ): Unregisters the event handler with the specified ID.
EventDescriptionArguments
CloseWindowSent when the window is requested to closed.