Click or drag to resize

JamBaseShellListView Class

The base listview class.
Inheritance Hierarchy

Namespace:  Jam.Shell
Assembly:  ShellBrowser.Winforms (in ShellBrowser.Winforms.dll) Version: 6.3.1
Syntax
public class JamBaseShellListView : SystemListView, 
	IShellControl, IShellControlConnectorTarget, ISupportInitialize, ISupportInitializeNotification, IComparer, 
	IShellCommandInvokable

The JamBaseShellListView type exposes the following members.

Constructors
  NameDescription
Public methodJamBaseShellListView
Constructor for the JamBaseShellListView.
Top
Properties
  NameDescription
Public propertyActiveImageList
Gets the ImageList that is currently used.
Public propertyAllowDrag
Use this property to turn on or off drag support with the Windows Explorer.
Public propertyAllowDrop
Use this property to turn on or off drop support with the Windows Explorer.
(Overrides ControlAllowDrop.)
Public propertyAutomaticRefresh
Set this property to true if you like the component to be refreshed automatically if a Drive is added or removed. This property is directly connected to the Enabled property of an internal instance of ShellChangeNotifier.
Protected propertyAutomaticRefresh_Internal
Indicates whether automatic refresh is enabled or not.
Public propertyAutoSizeColumn
Adjust the size of the given column so that it fills the remaining horizontal space.
Public propertyBackgroundContextMenu
Gets or sets the ContextMenuStrip that is displayed if no item of the listview is under the cursor if the user clicks the right mouse button. If this value is null, no ContextMenu is shown.
(Inherited from SystemListView.)
Public propertyCheckBoxes
Use this property to turn on or off the checkboxes for file and folder selection. The checkboxes will only work, if a ShellControlConnector has been assigned to the ShellControlConnector property of this component. It will automatically synchronize the selection state of the items in multiple shell controls linked together with this ShellControlConnector.
Public propertyCheckBoxMode
Use this property to display checkboxes for the control.
Public propertyCheckedItems
Refer to the SelectionList property to determine which items are selected. Please do not use this property, it is currently not supported. The CheckBoxes in an ordinary ListView do not support the grayed CheckState furthermore the ListView does not support them at all in View TileView.
Protected propertyCollectSelectedPaths
true if m_SelectedFiles should contain whole paths instead of files only.
Public propertyColumns
Gets the collection of all column headers that appear in the control.
Public propertyContextMenuRenderMode
Gets or sets the ToolStripRenderMode of the BackgroundContextMenu and the HeaderContextMenu.
Public propertyContextMenuStrip
The ContextMenuStrip is converted to an ordinary ContextMenu. This makes it possible to merge your ContextMenuStrip with the Default ShellContextMenu provided by the system. The "Opening" and "Closing" events of the ContextMenuStrip will be raised if the ContextMenu "Popup"/"Collapse" event occurs. For menu items only the "Click" event is available. All other events are not available. All ToolStripMenuItems are converted, and ToolStripSeparators are recognized. The ShortCut Keys defined in a ToolStripMenuItem are not converted. If you would like to have the ShortCut-Keys, leave this Property null, instead set the ContextMenu property to your menu explicitly.
Protected propertyCreateParams
Overwriting the CreateParams property to set the WS_VISIBLE flag; bug #8960
(Inherited from SystemListView.)
Protected propertyDesignMode
Gets a value indicating whether the design mode.
Protected propertyDetectLeftClick
Local variable to detect whether the mouse is clicked or dragged
Protected propertyDetectRightClick
Local variable to detect whether the mouse is clicked or dragged
Protected propertyDraggedDataObject
During a drag and drop operation that origins in this control this member contains the IDataObject. Filled in the ItemDrag method of the control.
Protected propertyDropItem
Gets or sets the item on that a current drag and drop operation would be executed.
Protected propertyDroppedDataObject
During a drag and drop operation this member contains the IDataObject that is dragged over the control. Filled in DragEnter.
Public propertyFastFolderThumbnails
In Thumbnail view, only load thumbnails that are already in the thumbnail cache for folders. Default value true will avoid potentially huge delays that are caused by live folder thumbnails reflecting the contents of the folder.
Public propertyFont
The font used to display text in the control.
(Overrides ControlFont.)
Public propertyHeaderMenuStrip
Gets or sets the ContextMenuStrip that will be shown if the user rightclicks on the headerbar. Get: If it's null, we generate a list of available columns.
Protected propertyHeaderRectangle
Returns the area occupied by the ListView header.
(Inherited from SystemListView.)
Public propertyHideSelection
Gets or sets a value indicating whether the selected item in the control remains highlighted when the control loses focus.
(Inherited from SystemListView.)
Protected propertyInitialized_Internal
Internal attribute is used by classes deriving from JamBaseShellListView.
Protected propertyInternalColumns
Gets the columns as JamShellColumnCollection.
Protected propertyIsEditing
Gets a value indicating whether this object is currently in edit-mode.
Public propertyIsInitialized
Gets a value indicating whether the component is initialized.
Public propertyIsInitializing
The value this property is true between the calls BeginInit() and EndInit() of the ISupportInitialize interface.
Public propertyCode exampleLargeCustomImages
Gets or sets an ImageList holding images that can be used as custom images in small viewstates.
Public propertyLargeImageList
Gets or sets a list of large images.
Public propertyNoFillOnStartup
If set to true, the control will not fill automatically after it was created. The FullRefresh method must be called explicitly. Since filling shell control with the appropriate items is a costly operation, this property can be useful to prevent unnecessary refreshes of the control.
Protected propertyNumShellColumns
The number of system columns without the columns added by the user.
Protected propertyPastedFiles
Contains the files that were pasted during a Paste operation.
Public propertySelectedFiles
This property provides access to a list of all files including their extension, which are currently selected in the ShellListView. Dependent on the user settings, the file names in the ListView may be displayed without extension, which makes it difficult to further process them when they are accessed only by the SelectedItems property. You can also use the SelectedFiles property to add files to the selection by using SelectedFiles.Add method.
Protected propertySelectedFiles_Internal
Simple getter/setter for m_SelectedFiles, for use by deriving classes.
Public propertyShellBrowser
Gets or sets the shellbrowser instance.
Protected propertyShellChangeNotifier
Returns the reference to the ShellChangeNotifier that is associated with this instance.
Public propertyShellContextMenu
Indicates whether the Windows ShellContextMenu should be shown or not.
Public propertyShellControlConnector
Connects this control to a ShellControlConnector component, which allows to synchronize several shell controls.
Public propertyShellDragDrop
Activates/deactivates the internal drag drop handling of the component.
(Inherited from SystemListView.)
Public propertyShowContextMenu
If set to true, the context menu will be shown if a right click event occurs.
Public propertyShowErrorMessages
If set to true the ShellList component will show a MessageBox if an error occured, otherwise the errors will only be logged to the Debug output.
Public propertyShowExtraLargeIcons
Obsolete: Use ViewState.ExtraLargeIcons instead.
Public propertyShowInfoToolTips
Whether to show the informational shell tooltips, the default is true
Public propertyShowShellContextMenuOnTop
If set to to 'true', the shell context menu will be shown on top of the provided popup menu. If set to 'false', the shell context menu will be shown below the provided popup menu. The value true is currently not supported. The menu items will be shown correctly, however their Click event cannot be triggered.
Public propertyCode exampleSmallCustomImages
Gets or sets an ImageList holding images that can be used as custom images in small viewstates.
Public propertySmallImageList
Gets or sets a list of small images.
Public propertySortColumn
The column according to which the listed objects are sorted. If this is set to a negative value, sorting is disabled by setting SortOrder to SortOrder.None, this is useful to insert large amounts of items, e.g. during a search.
Public propertySortColumnShellID
Gets or sets the current sort order.
Public propertySorting
Gets or sets the sort order for items in the control.
Public propertyThumbnailBorderColor
Get or set the color of the frame that is drawn around the thumbnails. If this value is set to null, no frame will be shown.
Public propertyThumbnails
Obsolete: Use ViewState.Thumbnails instead.
Public propertyThumbnailSize
Use the ThumbnailSize property to get or set the size in pixels of the thumbnail images.
Public propertyUsedShColumnIds Obsolete.
Returns an array of the currently used ShColumnIds.
Public propertyUseSlowInfoTip
If true, the slow tooltip that contains additional information like the folder size is used. Setting this value to false increases the performance.
Public propertyUseSystemFont
Set this property to true if you want the component to utilize the default system font. It is also set to true if the UseSystemStyles property is set.
(Inherited from SystemListView.)
Public propertyUseSystemStyles
Use this property to turn on or off the usage of the system specific design, i.e. enable Vista visual styles of the explorer components.
(Inherited from SystemListView.)
Public propertyVersion
The current version of the ShellBrowser.
Protected propertyVerticalScrollPos
Gets or sets the vertical scroll position.
Public propertyView
Overrides the ListView.View property. Use ViewState instead.
Protected propertyViewState
Gets or sets how items are displayed in the ListView control.
Public propertyVirtualListSize
Not supported.
Public propertyVirtualMode
Not supported.
Top
Methods
  NameDescription
Protected methodAddShellColumn(Int32)
Adds a shell column to the list view.
Protected methodAddShellColumn(Int32, Int32)
Adds a shell column with the given width to the list view.
Protected methodBaseOnDragDrop
Calls the original inherited OnDragDrop method.
Public methodBeginInit
Signals the object that initialization is starting.
Public methodClear
Removes all items and columns from the control.
Public methodClearColumns
Clears the current columns and the header context menu. Please use this method instead of ListView.Columns.Clear()>.
Public methodCompare
Override this method to compare objects given the SortColumn. The basic implementation compares the items alphabetically. If you need to change this, you can start out like this:
C#
public override int Compare(object x, object y)
{
    ShellListBaseItem item1 = x as ShellListBaseItem;
    ShellListBaseItem item2 = y as ShellListBaseItem;
    if (item1 == null || item2 == null)
        return 0;
    if (!SortColumnShellID.IsCustomId())
    {
        // the shell is asked
        ShellBrowser.SpecialFolder = ShellFolder.Desktop;
        if (Sorting == SortOrder.Ascending)
            return ShellBrowser.CompareIDs(item1.RelativeItemIdList, item2.RelativeItemIdList, m_SortColumnShellIndex);
        else
            return ShellBrowser.CompareIDs(item2.RelativeItemIdList, item1.RelativeItemIdList, m_SortColumnShellIndex);
    }
    else
    {
        // perform a normal alphanumeric compare
        if (Sorting == SortOrder.Ascending)
            return item1.SubItems[SortColumn].Text.CompareTo(item2.SubItems[SortColumn].Text);
        else
            return item2.SubItems[SortColumn].Text.CompareTo(item1.SubItems[SortColumn].Text);
    }
}
Protected methodCustomCompare
Compares the given items by the content of the subitems at the SortColumn index.
Public methodDisplayBackgroundContextMenu
Shows the BackgroundContextMenu if it is non-null.
Public methodDisplayContextMenu
Shows the shell context menu for the currently selected items
Public methodDisplayContextMenu(Point)
Shows the shell context menu for the currently selected items
Protected methodDisplayHeaderContextMenu
Empty handler of the HeaderRightClick event. This needs to be implemented by the deriving classes.
Protected methodDispose
Releases the unmanaged resources used by the ListView and optionally releases the managed resources.
(Overrides ListViewDispose(Boolean).)
Protected methodDoAutoSizeColumn
Autosizes the column that is set in AutoSizeColumn.
Public methodEnableSystemStyles
Sets system specific behaviour, i.e. FullRowSelect in Vista and upwards.
(Inherited from SystemListView.)
Public methodEndInit
Signals the object that initialization is complete. After this method is called, IsInitialized is true to indicate the state of the control.
Protected methodFinalizeColumnVisibilityChange
Finalizes the column visibility change. The sort column is checked and the column order updated.
Protected methodFindContextMenuPosition
finds the position where to display the context menu based upon the currently selected items and their positions
Protected methodFindItemIdList
Searches for the first list item with the given ItemIdList.
Protected methodFindPath
Returns the ListItem for the given path.
Public methodFolderChanged
Gets called if the active folder should change.
Public methodFullRefresh
Call a full refresh.
Protected methodGetColumnHeaderCollectionType
Gets the type of the column header collection.
Public methodGetColumnOrder
Retrieve the order in which columns appear.
(Inherited from SystemListView.)
Public methodGetIndexOfShColumnId(SHCOLUMNID)
Returns the local index for the given ShellColumnID (if the column is existing and visible)
Protected methodGetIndexOfShColumnId(SHCOLUMNID, Boolean)
Returns the local index for the given ShellColumnID.
Protected methodGetItemCollectionType
Protected methodGetListViewItemSorter
Return an instance of IComparer that should be used for sorting the lists in subclasses
Protected methodGetSelectedItemCollectionType
Public methodGetSelectedItemIdLists
Gets the items the command will be executed upon.
Protected methodGetSubItemBounds
Retrieve the bounds of a ListViewSubItem
(Inherited from SystemListView.)
Protected methodGetUIObject
Get the UI object.
Public methodGoUp
Goes up one directory level.
Protected methodHideColumn
Hides the column with the passed SHCOLUMNID.
Protected methodInitColumns
Initializes the columns.
Protected methodInvalidateSortColumns
For internal use: invalidates the current sort column.
Public methodCode exampleInvokeCommandOnSelected
Invokes the given command on the selected items. See ShellCommand class for a list of possible commands.
Public methodIsColumnVisible(Int32)
Returns whether the given column id is currently visible or not.
Public methodIsColumnVisible(SHCOLUMNID)
Returns whether the given SHColumnId is currently visible or not.
Protected methodIsColumnVisibleByDefault
Determines whether the column with the specified shellcolumnId is a column shown by default.
Public methodIsCustomColumn
Checks whether the given column index is a custom or shell column
Public methodIsEmpty
Checks if the list is empty.
Protected methodItemOfPidl
Returns the ListItem for the given ItemIdList
Protected methodLogError(String)
Error method that displays an error messagebox if the property ShowErrorMessages is set. The message is always written to the debug output stream
Protected methodLogError(String, Exception)
Error method that displays an error messagebox if the property ShowErrorMessages is set. The message is always written to the debug output stream
Public methodOnAfterInvokeCommand
Is called after the command has been called.
Protected methodOnAfterLabelEdit
Override the OnAfterLabelEdit event, to rename files or folders in the file system, when the have been renamed in the ShellListView.
(Overrides ListViewOnAfterLabelEdit(LabelEditEventArgs).)
Public methodOnBeforeInvokeCommand
Is called before the command is called.
Protected methodOnBeforeLabelEdit
Override the OnBeforeLabelEdit event, to prepare renaming a file or folder in the ShellListView.
(Overrides ListViewOnBeforeLabelEdit(LabelEditEventArgs).)
Protected methodOnBeforeShellColumnChanged
Calls the BeforeShellColumnChanged event if it is assigned.
Protected methodOnBeforeShellDrop
Calls the BeforeShellDrop event if it is assigned.
Protected methodOnCheckStateChanged
Fires an event if the CheckState of an item has changed.
Protected methodOnColumnClick
Sort the column, which is clicked.
(Overrides ListViewOnColumnClick(ColumnClickEventArgs).)
Protected methodOnColumnWidthChanged
Tracks column widths. Raises the System.Windows.Forms.ListView.ColumnWidthChanged event.
(Overrides ListViewOnColumnWidthChanged(ColumnWidthChangedEventArgs).)
Protected methodOnColumnWidthChanging
Prevents changes at designtime. Raises the ColumnWidthChanging event.
(Overrides ListViewOnColumnWidthChanging(ColumnWidthChangingEventArgs).)
Protected methodOnCreateColumns
Fires an event after the columns have been created
Protected methodOnCreateControl (Overrides ControlOnCreateControl.)
Protected methodOnDragDrop
This member overrides OnDragDrop(DragEventArgs) and resets the drag effect.
(Overrides ControlOnDragDrop(DragEventArgs).)
Protected methodOnDragEnter
This member overrides OnDragEnter(DragEventArgs) and adds drag images and cursors.
(Overrides ControlOnDragEnter(DragEventArgs).)
Protected methodOnDragLeave
This member overrides OnDragLeave(EventArgs) and resets the DropTargetHelper.
(Overrides ControlOnDragLeave(EventArgs).)
Protected methodOnDragOver
This member overrides OnDragOver(DragEventArgs) and adds drag images and cursors.
(Overrides ControlOnDragOver(DragEventArgs).)
Protected methodOnHandleCreated
Handles the OnHandleCreated event and e.g. initializes the image list
(Overrides SystemListViewOnHandleCreated(EventArgs).)
Protected methodOnHandleDestroyed
Tracks the handle destruction.
(Overrides ListViewOnHandleDestroyed(EventArgs).)
Protected methodOnHeaderContextMenuClick
Eventhandler for a HeaderContextMenuClick.
Protected methodOnHeaderRightClick
Raises the HeaderRightClick-Event
(Inherited from SystemListView.)
Protected methodOnItemChecked
Calls raising of the OnItemCheckedEvent.
Protected methodOnItemDrag
This member overrides OnItemDrag(ItemDragEventArgs)
(Overrides ListViewOnItemDrag(ItemDragEventArgs).)
Protected methodOnItemShowToolTip
This method is extended to show tool tip texts of the particular shell objects.
(Overrides SystemListViewOnItemShowToolTip(SystemListViewShowToolTipEventArgs).)
Protected methodOnMouseDown
Raises the System.Windows.Forms.Control.MouseDown event.
(Overrides ControlOnMouseDown(MouseEventArgs).)
Protected methodOnMouseUp
Overrides the OnMouseUp event, to handle e.g. double clicks and right clicks on files or folders and the selection of files or folders, when the CheckBoxes are switched on.
(Overrides ControlOnMouseUp(MouseEventArgs).)
Protected methodOnNotifyMessage
This method is called if a notification event is performed on the message pump WndProc(Message)
(Inherited from SystemListView.)
Protected methodOnOperation(ShellOperation, PathCollection, String, Exception)
Fires an event if an operation was performed on the JamBaseShellListView.
Protected methodOnOperation(ShellOperation, StringCollection, String, Exception)
Helper function for OnOperation(ShellOperation, PathCollection, String, Exception) to avoid type conversion.
Protected methodOnResize
Raises the OnResize event.
(Overrides ListViewOnResize(EventArgs).)
Protected methodOnShowOptionChanged
Calls the ShowOptionChanged event if it is assigned.
Protected methodPrepareMultiObjects Obsolete.
Prepares the selected items in the list for being used with the m_ShellBrowser, an instance of ShellBrowser.
Protected methodPreserveSystemStyle
This method preserves the Windows Vista light blue selection line if UseSystemStyles is on. The Setting is lost if e.g. a column is clicked to sort things.
(Inherited from SystemListView.)
Public methodRefresh(RefreshLevel)
This method indicates that the control should perform a refresh of its contents.
Public methodRefresh(RefreshLevel, ItemIdList)
This method indicates that the control should perform a refresh of its contents.
Protected methodRemoveItemFromList
Removes the list element from the list
Public methodResetColumns
Resets the columns to the initial state.
Protected methodResetItems
Resets the items and their subitems.
Protected methodRestoreItemSelection
Restores the selection and checkstate of the item.
Protected methodRestoreState
Counterpart of SaveState. Restores properties and possibly contents of the ListView.
Protected methodSaveCheckedItems
Saves the checked items.
Protected methodSaveColumnSettings
Saves the column settings.
Protected methodSaveSelection
Saves the current selection and checked items to a temporary List.
Protected methodSaveState
Saves the column properties of the current view, so that it can be restored later.
Protected methodScaleControl
Scales a control's location, size, padding and margin.
(Overrides ControlScaleControl(SizeF, BoundsSpecified).)
Protected methodSelectAllItemsInternal
Selects all items.
Public methodSelectedFileChange
Gets called if the selected file should change.
Protected methodSelectPidl(ItemIdList)
Selects the ListItem that corresponds to the given ItemIdList.
Protected methodSelectPidl(ItemIdList, Boolean)
Selects the ListItem that corresponds to the given ItemIdList.
Protected methodSetColumnBitmap
Set the sort icon among the current sort order in the passed column.
(Inherited from SystemListView.)
Protected methodSetColumnOrder
Sets the order in which columns appear.
(Inherited from SystemListView.)
Public methodSetColumnVisibility(Int32, Boolean)
Sets the visibility of a column.
Public methodSetColumnVisibility(SHCOLUMNID, Boolean)
Sets the visibility of a column.
Protected methodSetFont
Sets the font without adjusting other properties.
(Inherited from SystemListView.)
Protected methodSetSortOrder(SHCOLUMNID)
Sets and applies the SortColumn in ascending.
Protected methodSetSortOrder(SHCOLUMNID, SortOrder)
Sets and applies the sortrder.
Protected methodShowColumn
Shows the column with the passed ShellColumnId.
Public methodSmartRefresh
Call a smart refresh.
Public methodCode exampleSort
Sorts the items of the list view. Uses a custom sort order if an IComparer is assigned to property ListViewItemSorter. If no custom sortorder is supplied the default sorting handles sorting by columns and is only useful in Details. In this case SortColumn must be non-negative.
Protected methodUpdateColumnBitmaps
Updates the sort icon in the column of the ShellListView.
Protected methodUpdateSubitemsAfterColumnGetsVisible
Loads subitems for a column that has been added at the passed position.
Protected methodWndProc (Overrides ListViewWndProc(Message).)
Top
Events
  NameDescription
Public eventBeforeInvokeCommandOnSelected
Assign this event to be able to control the behaviour of the control when the user double-clicks on an item to start the default action
(Inherited from SystemListView.)
Public eventBeforeShellColumnChanged
This event is fired when a column is selected/deselected from the context menu of the list header.
Public eventCode exampleBeforeShellCommand
This event is fired when a shell command is to be executed, ie. via the context menu It is possible to permit the execution of the shell command by modifying the BeforeShellCommandEventArgs
Public eventBeforeShellDrop
This event is fired before a ListView that inherits from JamBaseShellListView executes a shell drop.
Public eventCheckStateChanged
This event is fired when the state of a checkbox was changed by the user or if it was changed internally via checkstate synchronization of other controls.
Public eventCode exampleCreatedColumns
This event is fired after the columns were created.
Public eventHeaderRightClick
The event is triggered when the user right clicks on the column headers.
(Inherited from SystemListView.)
Public eventInitialized
This event is fired after the initialization of the component.
Public eventItemChecked
Occurs when the checked state of an item was changed by the user.
Public eventItemShowToolTip
This event occurs if the user moved the mouse over a listview item so a tooltip can appear, this event also occurs if no ToolTipText is set, it can be added dynamically.
(Inherited from SystemListView.)
Public eventOperationPerformed
This event is fired after a JamBaseShellListView executed a shell operation like copying.
Public eventShowOptionChanged
This event is fired after a display option, like e.g. the ViewState changed.
Public eventCode exampleThumbnailUpdated
This event is fired for each item in Thumbnail view. It can be used to update the thumbnail.
Top
Fields
  NameDescription
Public fieldStatic memberJamHiddenColumnWidth
used to mark hidden columns in the array of saved column widths
Protected fieldm_InitialSortColumnIndex
Zero-based index of the initial sort column. -2 means: Default value not overriden or already applied
Protected fieldm_SortColumnIndex
The current sort order as index of column.
Protected fieldm_SortColumnShellIndex
The shell index of the sort column. Default is 0 - the name column.
Protected fieldm_SortOrder
The initial sort order.
Top
Extension Methods
  NameDescription
Public Extension MethodHandleNeeded
A Control extension method that ensures that the handle for a control is created.
(Defined by ExtensionMethods.)
Public Extension MethodScaledPixels
An extension method for controls: It scales the passed pixels according to the current dpi the control is displayed with.
(Defined by ExtensionMethods.)
Public Extension MethodScaleFont
A Control extension method that scales font according to the passed factor.
(Defined by ExtensionMethods.)
Top
See Also