Blayd File System UI

File System UI

Specification

Blayd File System UI is a component and control library for Windows Forms. The component targets the .Net Framework version 2.0 but is supported on versions 3.0 and 3.5. The Blayd File System UI library is run time royalty free so developers using one or more of the components or controls in the library can ship the library with their application without charge. A developer license is required to use the Blayd File System UI library at design time but the library can be evaluated free of charge for a period of 14 days. Whilst in evaluation mode the Blayd File System UI library is fully functional, however, the library will only operate from within the development environment.

Product Features

The Blayd File System UI library contains components and controls that provide a user interface representation of file system devices, folders and files. Developers can use the components and controls in their Windows Forms applications to easily display file system information to the user. The data source components, when data bound to the user interface controls, provide the developer with a significant level of functionality within the designer and a lot can be achieved without writing any code.

The library is designed to make it easy for developers to display file system information when creating user interfaces for applications such as file backup and archive, file explorers and custom file open or save as dialogs. The library does not provide any underlying file processing functionality, such as file copy, move, delete, etc. but it does make it relatively easy to create a user interface that initiates file processing by, for example, fully supporting folder and file copy and paste and folder and file drag and drop. The events implemented in the components and controls allow the developer to write code to react to user initiated actions to, for example, provide any necessary underlying file processing.

Controls

FolderTreeView

FolderTreeView Control

The FolderTreeView control is a specialised extension of the familiar TreeView control that fully integrates, through data binding, with the FolderList (see below) data source component. The FolderTreeView control provides a DataSource property to enable developers to data bind the control to any component that implements the IHierarchicalDataSource interface, which is also contained in the Blayd File System UI library.
FolderTreeView Display FolderTreeView CheckBox Display

Because the FolderTreeView control extends the existing TreeView control, all of the features familiar to users of the TreeView control are inherited by and are therefore available in the FolderTreeView control. You can, for example, still display a check box next to each node, as shown in the figure above on the right.

When using the data binding capability of the FolderTreeView control developers can create a functional, read only, display of file system data from within the designer without writing any code.

Developers can specify their own "stock" images for the "virtual" Computer (My Computer on Windows XP) folder, the various drive types and folders by populating and assigning an image list to the ImageList property. Choose to use Windows XP, Windows Vista or your own style of image.

By default, the FolderTreeView control automatically generates a context menu that is displayed whenever the user right clicks a node in the control. The FolderTreeView control automatically handles some of the context menu commands such as the Expand | Collapse, Rename and Refresh commands and surfaces the other commands such as Cut, Copy, Delete and Paste as events that can be handled by developers in their own code.

The FolderTreeView control provides an ideal solution for displaying the hierarchical file system object data provided by the FolderList data source component. However, because the FolderTreeView control uses the IHierarchicalDataSource interface and the other hierarchical data interfaces contained in the Blayd File System UI library, the control can data bind to and display the data of any classes that implement these interfaces.

FolderDropDownList

FolderDropDownList Control

The FolderDropDownList control lists and displays a hierarchical node structure in a way that is similar to the familiar combo box control. The purpose of the FolderDropDownList control is to allow the user to specify the path of a selected node and to facilitate such a selection the control is typically used in conjunction with another control, such as the FileListView (see below) control, to provide a user interface similar to the familiar file open and save as dialogs.

The FolderDropDownList control fully integrates, through data binding, with the FolderList (see below) data source component. The FolderDropDownList control provides a DataSource property to enable developers to data bind the control to any component that implements the IHierarchicalDataSource interface, which is also contained in the Blayd File System UI library.

FolderDropDownList Closed Display FolderDropDownList Open Display

When closed the FolderDropDownList control displays a compact view of the currently selected node, however, when open, the FolderDropDownList control displays the full path of the currently selected node and the user can navigate up the hierarchical path of the selected node, select a level one node or navigate back to the root node.

When using the data binding capability of the FolderDropDownList control developers can create a functional display of file system data from within the designer without writing any code.

Developers can specify their own "stock" images for the "virtual" Computer (My Computer on Windows XP) folder, the various drive types and folders by populating and assigning an image list to the Images property. Choose to use Windows XP, Windows Vista or your own style of image.

The FolderDropDownList control provides an ideal solution for displaying a compact view of the current, selected, path of the hierarchical file system object data provided by the FolderList data source component. However, because the FolderDropDownList control uses the IHierarchicalDataSource interface and the other hierarchical data interfaces contained in the Blayd File System UI library, the control can data bind to and display the data of any classes that implement these interfaces.

FileListView

FileListView Control

The FileListView control is a specialised extension of the familiar ListView control that fully integrates, through data binding, with the FileList (see below) data source component. The FileListView control provides a DataSource property to enable developers to data bind the control to the FileList component.

The FileListView control lists and displays the file system objects contained in a single file system folder. The list may contain the file system objects of the "virtual" Computer (My Computer on Windows XP) folder, in which case the list will contain disk drives or the list may contain the file system objects of a conventional folder, in which case the list will contain sub-folders and/or files.

FileListView List Display FileListView Details Display

The FileListView control supports all of views it inherits from the ListView control but extends the view concept to provide a "drive item" view for displaying the devices contained in the "virtual" Computer folder and a "file/folder item" view for displaying the sub-folders and files contained in a conventional file system folder.

When using the data binding capability of the FileListView control developers can create a functional, read only, display of file system data from within the designer without writing any code.

Developers can specify their own "stock" images for the various drive types and folders by assigning image lists to SmallImages and LargeImages properties. Choose to use Windows XP, Windows Vista or your own style of image. Developers can use the same image lists with the FileList component when data binding and initialize the FileList component to assign the key of the relevant "stock" image to drive and sub-folder items as they are loaded. The FileList data source component will populate the image lists with the icons associated with the file types that it loads, therefore, when data bound to an initialized FileList component, the FileListView control will automatically display the image associated with each of the files it displays.

By default, the FileListView control automatically generates the column headers required for the Details view of both of its own file system specific views i.e. drive item view and folder/file item view. Developers can customize the automatically generated column headers or the automatic generation feature can be turned off and developers can create their own column headers.

By default, the FileListView control automatically generates display groups for its own drive item view if the operating system supports grouping in ListView controls. Developers can customize the automatically generated groups or the automatic generation can be turned off.

By default, the FileListView control automatically generates a context menu that is displayed when the user right clicks a display item or right clicks in the client area of the control, different context menu items are displayed for each of the two right click actions. The FilsListView control automatically handles some of the context menu commands such as the View and Arrange Icons By commands and surfaces the other commands such as Cut, Copy, Delete and Paste as events that can be handled by developers in their own code.

The FileListView control provides sorting, in all views and both item views, view switching and the placing of display items in to edit mode from its automatically generated context menu.

The FileListView control can link to and synchronize with another control, such as the FolderDropDownList control or the FolderTreeView control by linking the data source components that the controls are data bound to.

Components

FolderList

FolderList Component

The FolderList data source component loads and manages a hierarchical list of file system folders and provides data binding functionality to user interface components and controls through its IHierarchicalDataSource interface implementation.

The hierarchical list created by the FolderList component descends from a single, level zero, root node. The root node can be specified as the "virtual" Computer (My Computer on Windows XP) folder in which case the level one nodes will all be drives. The root node can also be specified as a specific drive, "C", "D", etc. in which case the level one nodes will all be folders. The value "System" can also be specified to instruct the FolderList component to load the drive containing the operating system as the root node, regardless of its drive letter. The root node can also be specified as a specific folder, in which case the level one nodes will all be folders i.e. sub-folders of the root node folder.

The FolderList component supports "on demand" loading of sub-folders. When sepecified, the component will only load one level of sub-folders, rather than the entire hierarchy, during the initial load. This technique improves performance and reduces resource usage when loading the folder hierarchy of large disks with lots of folders.

The FolderList component can be initialized to assign the unselected and selected image index or image key of the images associated with the user interface control to which it is data bound. When initialized in this way, the FolderList component will assign the relevant image value, e.g. local drive, remote drive, CD-DVD drive, folder, etc. to each of the nodes that it loads and data bound controls such as the FolderDropDownList and FolderTreeView control will automatically display the correct image for each type of node.

The FolderList data source component only reads from the file system, it does not write to or update the file system. However, nodes may be added to or removed from the hierarchical list managed by the FolderList component and nodes in the list may be renamed. The FolderList component surfaces list changed events that may be handled by data bound controls or developer code to perform the required file system updates.

Although the FolderList data source component is primarily intended to provide file system data, through data binding, to user interface controls it can be used entirely from code.

FileList

FileList Component

The FileList data source component loads and manages a list of the sub-folders and files contained in a file system folder.

The FileItemBindingList provided by the FileList data source component can be data bound, for example, to the BindingSource component, the FileListView control and the DataGridView control and to any other component or control that supports the IListSource interface and the IBindingList interface.

The FileList data source component can be linked, as a child data source, to any component that implements the IHierarchicalDataSource interface, such as, for example, the FolderList data source. When linked to another data source component, the FileList component notifies the linked data source when its list changes and it handles the events raised by the linked data source so that it can react when the linked data source's list changes.

The AssociatedImages and AssociatedLargeImages properties can be used to specify image lists which the FileList component will populate with the small and large image associated with each file type that it loads. Controls, such as the FileListView, that are data bound to the FileList component can use the same image lists and the images they contain when displaying the list items.

The FileList component can be initialized to assign the image key of the drive type and folder images contained in the image lists reference by the AssociatedImages and AssociatedLargeImages properties. When initialized in this way, the FileList component will assign the relevant image value, e.g. local drive, remote drive, CD-DVD drive, folder, etc. to each of the file items that it loads and data bound controls such as the FileListView control will automatically display the correct image for each type of file item.

ChooseDetailsDialog

ChooseDetailsDialog Component

The ChooseDetailsDialog component provides a dialog box in which the user can select, reorder and resize the column headers for an associated instance of the FileListView control. The FileListView control displays column headers when its View property is set to Details. Developers can use the ChooseDetailsDialog component to display a dialog that allows the user to edit the column header settings.

When the FileListView control's AutoGenerateContextMenu property is set to true, the control uses the ChooseDetailsDialog to automatically display the "Choose Details" dialog from the relevant option on its context menu. However, developers that are not using the automatic context menu generation feature can use the ChooseDetailsDialog directly from their own code to display the "Choose Details" dialog.

When the ChooseDetailsDialog component is associated with an instance of the FileListView control, the settings made by the user in the dialog will automatically be used to update the FileListView control when the user clicks the OK button.

The ChooseDetailsDialog component can be associated with an instance of the FileListView control by setting the ViewControl property or by passing an instance of the control to the relevant ShowDialog method overload.