IShellListing
Instances of IShellListing represent the Objects inside the Listing View tree in the M-Files Client application UI. The interface
is available for example from ActiveListing
property of IShellFrame.
See the Overview chapter Listing View for more details how to operate the object.
Properties
Name | Type | Description |
---|---|---|
applicationNotifier | ApplicationNotifier | Application notifier for notifying the changes to all applications. |
CurrentPath | string | Gets the current location as a path. |
CurrentSelection | IShellItems | |
Events | IEvents | Returns the event registering interface of the IShellListing interface. |
IsActive | boolean | Checks if this listing window is currently the active listing window. |
Items | IShellItems |
Methods
Name | Description |
---|---|
ActivateListing | Makes this listing window the active listing in the shell frame. |
ActivateSelected | Performs the default action for currently selected item. |
AddListingItem | Adds a new item to the relevant listings. It is a new method added for vNext. |
AddObjectFile | Perform add file for MFD. |
GetFolderName | Returns the display name of a folder in the current listing. |
RefreshListing | Refreshes the current listing. |
RefreshObject | Refreshes the specified object in the listing. |
RemoveListingItem | Removes an item or items in an array from the listing. It is a new method added for vNext. |
ReplaceFile | Perform file replace. |
SelectFolder | Moves the selection to the folder item. |
SelectNextFolder | Moves the current selection to the next folder item. |
SelectNextObject | Moves the current selection to the next object (object version) item. |
SelectNextObjectFile | Moves the current selection to the next object file. |
SelectObjectFile | Selects the object (object version) item. |
SelectObjectOrObjectFileVersion | Selects object or file version in the listing window. |
SelectObjectVersion | Selects the object file item. |
SelectPrevFolder | Moves the current selection to the previous folder. |
SelectPrevObject | Moves the current selection to the previous object (object version) item. |
SelectPrevObjectFile | Moves the current selection to the previous object file item. |
SetFolderOrObjectVersionSelectionStates | Selects or unselects both property folders and object versions. |
SetFolderSelectionStates | Selects or unselects property folders. |
SetObjectOrObjectFileVersionSelectionStates | Selects or unselects objects or object files. |
SetObjectVersionSelectionStates | Selects or unselects object versions. |
SetVirtualSelection | Overrides the items selection with a virtual selection. Items should be valid objects, otherwise the method will throw an exception and selection will not be changed. |
UnselectAll | Unselects the current selection. |
UpdateListingItem | Update a the items in the listing. It is a new method added for vNext. |
Events
ContentChanged
Triggered when the current listing content is changed, or listed items are modified.
MFiles.Event.ContentChanged
Arguments:
- shellItems : IShellItems Contains all items in the listing.
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ContentChanged,
(
shellItems, // [IShellItems](/UIExt2/Interfaces/IShellItems/)
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
ListingActivated
Triggered when the listing object becomes active and receives the input focus.
MFiles.Event.ListingActivated
Arguments:
- shellListing : IShellListing The previous active shell listing object. Can be null.
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ListingActivated,
(
shellListing, // [IShellListing](/UIExt2/Interfaces/IShellListing/)
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
ListingDeactivated
Triggered when the listing object becomes inactive and loses the input focus.
MFiles.Event.ListingDeactivated
Arguments:
- shellListing : IShellListing The next active shell listing object. Can be null.
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ListingDeactivated,
(
shellListing, // [IShellListing](/UIExt2/Interfaces/IShellListing/)
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
ListItemAdded
MFiles.Event.ListItemAdded
Arguments:
- objectVersion :
object
Object
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ListItemAdded,
(
objectVersion, // `object`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
ListItemModified
?
MFiles.Event.ListItemModified
Arguments:
- oldServerObjVer :
Array
<any
> Array - newObjVer :
Array
<any
> Array
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ListItemModified,
(
oldServerObjVer, // `Array` <`any` >
newObjVer, // `Array` <`any` >
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
ListItemRemoved
MFiles.Event.ListItemRemoved
Arguments:
- listItem :
Array
<any
> Array - removecExternalFolder :
object
Object
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.ListItemRemoved,
(
listItem, // `Array` <`any` >
removecExternalFolder, // `object`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectedItemsChanged
Triggered when one or more of the items that are currently selected are modified.
MFiles.Event.SelectedItemsChanged
Arguments:
- shellItems : IShellItems Contains the selected items.
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectedItemsChanged,
(
shellItems, // [IShellItems](/UIExt2/Interfaces/IShellItems/)
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectionChanged
Triggered when the selection in the listing view is set, changed or removed.
MFiles.Event.SelectionChanged
Arguments:
- shellItems : IShellItems Contains the selected items.
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectionChanged,
(
shellItems, // [IShellItems](/UIExt2/Interfaces/IShellItems/)
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectNextFolder
MFiles.Event.SelectNextFolder
Arguments:
- folderType :
number
Number
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectNextFolder,
(
folderType, // `number`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectNextObject
MFiles.Event.SelectNextObject
Event has no arguments
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectNextObject,
() => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectNextObjectFile
MFiles.Event.SelectNextObjectFile
Arguments:
- allowMoveToNextObject :
boolean
Boolean
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectNextObjectFile,
(
allowMoveToNextObject, // `boolean`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectPreviousFolder
MFiles.Event.SelectPreviousFolder
Arguments:
- folderType :
number
Number
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectPreviousFolder,
(
folderType, // `number`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectPreviousObject
MFiles.Event.SelectPreviousObject
Event has no arguments
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectPreviousObject,
() => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SelectPreviousObjectFile
MFiles.Event.SelectPreviousObjectFile
Arguments:
- allowMoveToPrevObject :
boolean
Boolean
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SelectPreviousObjectFile,
(
allowMoveToPrevObject, // `boolean`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
SendTelemetry
MFiles.Event.SendTelemetry
Arguments:
- telemetryEvent :
TelemetryEvents
TelemetryEvents - eventProperties :
object
Object
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.SendTelemetry,
(
telemetryEvent, // `TelemetryEvents`
eventProperties, // `object`
) => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
Started
Sent when the object turns to started state.
MFiles.Event.Started
Event has no arguments
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.Started,
() => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);
Stop
Sent before the object is stopped.
MFiles.Event.Stop
Event has no arguments
Example Code
const eventHandle = await shellListing.Events.Register(
MFiles.Event.Stop,
() => {
// Handle event
},
);
// Later unregister the event
shellListing.Events.Unregister(eventHandle);