Class FileListBox
VirtualListBox descendant which allows to browse folder contents.
public class FileListBox : StdTreeView, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, ILayoutItem, INotifyDataErrorInfo, ITreeViewItemContainer
- Inheritance
-
FileListBox
- Implements
Constructors
- FileListBox()
Initializes a new instance of the FileListBox class.
- FileListBox(AbstractControl)
Initializes a new instance of the FileListBox class.
Fields
- AddDrivesToRootFolder
Gets or sets whether to add all drives (c:, d:, etc.) to the list of the special folders.
- AdditionalSpecialFolders
Gets or sets list of additional special folders. If specified, these folders will be added to the list of root level folders.
- ColumnIdentifierDateModified
Represents the identifier for the 'Date Modified' column.
- ColumnIdentifierName
Represents the identifier for the file name column.
- ColumnIdentifierSize
Represents the identifier for the file size column.
- ColumnsOrder
Specifies the default order of columns.
- DefaultColumnWidthDateModified
Specifies the default width, in dips, for the 'Date Modified' column in the user interface.
- DefaultColumnWidthName
Specifies the default width, in dips, for the name column in the user interface.
- DefaultColumnWidthSize
Specifies the default width, in dips, for the file size column in the user interface.
- DefaultDateFormat
Gets or sets the default format string used for displaying date values. This format string is used in the file list to represent date information, such as file modification dates.
- DefaultFileImage
Gets or sets default svg image used for the "file" items.
- DefaultFolderImage
Gets or sets default svg image used for the "folder" items.
- DefaultTimeFormat
Gets or sets the default format string used for displaying time values. This format string is used in the file list to represent time information, such as file modification times.
- DriveItemTemplate
Gets or sets template for the drive item when it is added to the list of the special folders. Default is "{0}".
- FileImageColorOverride
Gets or sets a function that provides a color override for file icons. This function returns a LightDarkColor object, which specifies the color to be used for file icons in light and dark themes.
- FolderImageColorOverride
Gets or sets a function that provides a color override for folder icons. This function returns a LightDarkColor object, which specifies the color to be used for file icons in light and dark themes.
- FolderInfo
Gets or sets global FileListBox.FolderInfoItem for the file or folder. FileListBox.FolderInfoItem allows to specify icon, custom title and some other information.
- HiddenSpecialFolders
Gets or sets list of special folder which are hidden.
- SelectedFolderImageColorOverride
Gets or sets a function that determines the color override for the selected folder image.
- UseSolidFileDefaultImages
Gets or sets a value indicating whether to use solid default images for file items when DefaultFileImage not specified.
- UseSolidFolderDefaultImages
Gets or sets a value indicating whether to use solid default images for folder items when DefaultFolderImage not specified.
- VisibleSpecialFolders
Gets or sets list of visible special folders. If specified, only these folders will be visible on the root level.
Properties
- AddRootFolderItem
Gets or sets whether to add "/" item which allows to open root folder.
- AddUpperFolderItem
Gets or sets whether to add ".." item which allows to open parent folder.
- AllowGoToSubFolder
Gets or sets whether double click on folder opens its content in the control.
- ColumnDateModified
Gets the column used to display file modification dates.
- ColumnName
Gets the column used to display file names.
- ColumnSize
Gets the column used to display file sizes.
- DateFormat
Gets or sets the format string used to display date values. This format string is used in the file list to represent date information, such as file modification dates. If set to null (default value), the default format DefaultDateFormat is used.
- FileFilterPredicate
Gets or sets the predicate used to filter file names.
- FolderFilterPredicate
Gets or sets the predicate used to filter folder names.
- IsReloading
Gets whether control is reloading and selection change events should be ignored.
- SearchPattern
Gets or sets search pattern which allows to limit files shown in the control. An example: ".uixml". Default value is "" (all files).
- SelectedFolder
Gets or sets folder which is currently opened in the control.
- SelectedItem
Gets or sets item which is currently selected.
- SelectedItemIsFile
Gets whether selected item is file.
- SelectedItemPath
Gets path of the selected item. When this property is changed, selected item is updated to the item with the specified path.
- Sorted
Gets or sets whether folder and file names are sorted. Default value is
true.
- TimeFormat
Gets or sets the format string used to display time values. This format string is used in the file list to represent time information, such as file modification times.
Methods
- AddFile(NewItemInfo)
Adds file to the control.
- AddFile(string?, string, SvgImage?)
Adds file to the control.
- AddFolder(NewItemInfo)
Adds folder to the control.
- AddFolder(string?, string, SvgImage?)
Adds folder to the control.
- AddFolderWithFlags(string?, string, SvgImage?, FolderAdditionFlags)
Adds a folder to the collection with the specified title, path, and optional image, applying the specified folder addition flags.
- AddSpecialFolder(SpecialFolder, string?)
Adds special folder specified using Environment.SpecialFolder enumeration.
- AddSpecialFolders()
Adds all special folders to the control. VisibleSpecialFolders and HiddenSpecialFolders can be used to specify what folders are added.
- GetComparison(FileListBoxColumn, bool)
Retrieves a comparison delegate for sorting FileListBoxItem objects based on the specified column.
- GetDefaultFileImage()
Gets the default SVG image used for file items. If DefaultFileImage is not set, a known default file icon is returned.
- GetDefaultFolderImage()
Gets the default SVG image used for folder items. If DefaultFolderImage is not set, a known default folder icon is returned.
- GetFileImage()
Gets the SVG image used for file items. If DefaultFileImage is not set, a known default file icon is returned.
- GetFolderImage()
Gets the SVG image used for folder items. If DefaultFolderImage is not set, a known default folder icon is returned.
- ItemIsFile(FileListBoxItem?)
Gets whether item is file.
- ItemIsFolder(FileListBoxItem?)
Gets whether item is folder.
- NavigateToParentFolder()
Navigates to the parent folder. If the parent folder is the same as the current folder, it navigates to the root folder. If an exception occurs, it logs the exception and resets the selected folder to null. This method is called when parent folder item is double-clicked.
- NavigateToRootFolder()
Navigates to the root folder. By default, this method sets the SelectedFolder property to
null, effectively navigating to the root folder. This method is called when root folder item is double-clicked.
- OnDateModifiedColumnClick()
Handles a click event on the Date Modified column header and initiates sorting of the items by the date modified value.
- OnKeyDown(KeyEventArgs)
Called when the KeyDown event is raised.
- OnNameColumnClick()
Sorts the items in the file list by the name column when the name column header is clicked.
- OnSizeColumnClick()
Handles a click event on the size column header and initiates sorting of items by their size.
- Reload()
Reloads contents of the currently opened folder.
- RequireDefaultColumns()
Initializes the default columns for the file list box, including columns for file name, date modified, and file size, with predefined widths and identifiers.
- RequireDefaultHeader()
Configures the default header layout for the file list, ensuring required columns are added and enabling sorting functionality for each column.
- ResetSortDirections()
Resets the sort directions for all columns to their default values.
- SelectFolderByFileName(string?)
Selects a folder by file name or folder path.
- SelectFolderIfExists(string?)
Selects the specified folder if it exists, or selects the folder containing the specified file if applicable.
- SelectInitialFolder(bool)
Selects the initial folder for the operation, resetting any previously selected folder.
- Sort(FileListBoxColumn, ColumnSortDirection)
Sorts the items in the file list based on the specified column and sort direction.
Events
- AddRootFolder
Occurs when root folder items are added to the control. This event is called when SelectedFolder is assigned with
nullvalue.
- SelectedFolderChanged
Occurs when the SelectedFolder property value changes. This event is raised after the folder selection has been updated.