Skip to main content

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

NameTypeDescription
EventsIEventsReturns the event registering interface of the IShellUI interface.
VaultIVaultReturns the logged-in M-Files server connection.

Methods

NameDescription
BroadcastMessageSends a synchronous broadcast message to all shellUI modules of all applications running in the current shellUI (main-window).
GetFileTypeIconURLReturns the file type icon from the filename extension as data url.
GetObjectTypeIconURLGets the URL of the icon for the specified object type.
NotifyApplicationSends a synchronous notification message to all shellUI modules of a specific application running in the current shellUI (main-window).
ShowMessageShows the default M-Files message box with the specified content and appearance.
ShowPopupDashboardShows 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:

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:

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);