IShellUI
The IShellUI is available for the Modules on the module startup event
The IShellUI is available for the Dashboards from the ShellFrame property of the IDashboard.
Properties
Name | Type | Description |
---|---|---|
Events | IEvents | Returns the event registering interface of the IShellUI interface. |
Vault | IVault | Returns the logged-in M-Files server connection. |
Methods
Name | Description |
---|---|
BroadcastMessage | Sends a synchronous broadcast message to all shellUI modules of all applications running in the current shellUI (main-window). |
GetFileTypeIconURL | Returns the file type icon from the filename extension as data url. |
GetObjectTypeIconURL | Gets the URL of the icon for the specified object type. |
NotifyApplication | Sends a synchronous notification message to all shellUI modules of a specific application running in the current shellUI (main-window). |
ShowMessage | Shows the default M-Files message box with the specified content and appearance. |
ShowPopupDashboard | Shows a dashboard in a separate window. |
Events
CrossApplicationNotification
Broadcasted message to multiple applications.
MFiles.Event.CrossApplicationNotification
Arguments:
- appGUID :
string
- GUID of the target application, this can be also null - msgId :
String
- ID of the message which is sent to the other application - data :
any
- data to be sent
Example Code
const eventHandle = await shellUI.Events.Register(
MFiles.Event.CrossApplicationNotification,
(
appGUID, // `string`
msgId, // `String`
data, // `any`
) => {
// Handle event
},
);
// Later unregister the event
shellUI.Events.Unregister(eventHandle);
NewNormalShellFrame
Triggered when a normal shell frame object (not a common dialog, and not an embedded or special shell frame) is created.
MFiles.Event.NewNormalShellFrame
Arguments:
- shellFrame : IShellFrame The new shell frame object.
Example Code
const eventHandle = await shellUI.Events.Register(
MFiles.Event.NewNormalShellFrame,
(
shellFrame, // [IShellFrame](/UIExt2/Interfaces/IShellFrame/)
) => {
// Handle event
},
);
// Later unregister the event
shellUI.Events.Unregister(eventHandle);
NewShellFrame
Triggered when any shell frame object is created.
MFiles.Event.NewShellFrame
Arguments:
- shellFrame : IShellFrame The new shell frame object.
Example Code
const eventHandle = await shellUI.Events.Register(
MFiles.Event.NewShellFrame,
(
shellFrame, // [IShellFrame](/UIExt2/Interfaces/IShellFrame/)
) => {
// Handle event
},
);
// Later unregister the event
shellUI.Events.Unregister(eventHandle);
Started
Sent when the object turns to started state.
MFiles.Event.Started
Event has no arguments
Example Code
const eventHandle = await shellUI.Events.Register(MFiles.Event.Started, () => {
// Handle event
});
// Later unregister the event
shellUI.Events.Unregister(eventHandle);
Stop
Sent before the object is stopped.
MFiles.Event.Stop
Event has no arguments
Example Code
const eventHandle = await shellUI.Events.Register(MFiles.Event.Stop, () => {
// Handle event
});
// Later unregister the event
shellUI.Events.Unregister(eventHandle);