C# Класс BrightIdeasSoftware.ObjectListView

Наследование: System.Windows.Forms.ListView, ISupportInitialize
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EditorRegistry EditorRegistry
SortAscendingImage Bitmap
SortDescendingImage Bitmap

Private Properties

Свойство Тип Описание
AddCheckStateBitmap void
ApplyHyperlinkStyle void
BuildBeforeSortingEventArgs BrightIdeasSoftware.BeforeSortingEventArgs
BuildCellEvent void
CalculateCellBounds System.Drawing.Rectangle
CalculateCheckState CheckState
CalculateToggledCheckState CheckState
ColumnSelectMenuClosing void
ColumnSelectMenuItemClicked void
DoSort void
FindGlassPanelForOverlay GlassPanelForm
GetCheckedObject object
GetCheckedObjects ArrayList
GetFirstNonNullValue object
GetSelectedObject object
GetSelectedObjects ArrayList
HandleHeaderRightClick bool
HandleModelOnPropertyChanged void
HeaderToolTipShowingCallback void
LowLevelScroll void
MakeResizedImage Bitmap
MakeResizedImageList ImageList
MakeSubItem OLVListSubItem
MakeTriangleBitmap Bitmap
PrepareAlternateBackColors void
RememberDisplayIndicies void
RunWhenIdle void
SetAllSubItemImages void
SetGroupSpacing void
SetupBaseImageList void
ShouldShowOverlays bool
ShowColumnCommandMenu void
ShowColumnSelectMenu void
StateToString string
SubscribeNotifications void
ToggleSelectedRowCheckBoxes void
UnsubscribeNotifications void

Открытые методы

Метод Описание
AddDecoration ( IDecoration decoration ) : void

Add the given decoration to those on this list and make it appear

A decoration scrolls with the listview. An overlay stays fixed in place.

AddObject ( object modelObject ) : void

Add the given model object to this control.

See AddObjects() for more details

AddObjects ( ICollection modelObjects ) : void

Add the given collection of model objects to this control.

The added objects will appear in their correct sort position, if sorting is active (i.e. if LastSortColumn is not null). Otherwise, they will appear at the end of the list.

No check is performed to see if any of the objects are already in the ListView.

Null objects are silently ignored.

AddOverlay ( IOverlay overlay ) : void

Add the given overlay to those on this list and make it appear

AutoResizeColumns ( ) : void

Resize the columns to the maximum of the header width and the data.

BuildGroups ( ) : void

Organise the view items into groups, based on the last sort column or the first column if there is no last sort column

BuildGroups ( OLVColumn column, SortOrder order ) : void

Organise the view items into groups, based on the given column

If the AlwaysGroupByColumn property is not null, the list view items will be organisd by that column, and the 'column' parameter will be ignored.

This method triggers sorting events: BeforeSorting and AfterSorting.

BuildGroups ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : void

Organise the view items into groups, based on the given columns

This method does not trigger sorting events. Use BuildGroups() to do that

BuildList ( ) : void

Build/rebuild all the list view items in the list, preserving as much state as is possible

BuildList ( bool shouldPreserveState ) : void

Build/rebuild all the list view items in the list

Use this method in situations were the contents of the list is basically the same as previously.

CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle

Return the bounds of the given cell

CalculateCellEditorBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column

CalculateCellTextBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle

Return the bounds of the given cell only until the edge of the current text

CalculateReasonableTileSize ( ) : void

Give the listview a reasonable size of its tiles, based on the number of lines of information that each tile is going to display.

CancelCellEdit ( ) : void

Stop editing a cell and throw away any changes.

ChangeToFilteredColumns ( View view ) : void

Rebuild this list for the given view

CheckIndeterminateObject ( object modelObject ) : void

Mark the given object as indeterminate check state

CheckIndeterminateSubItem ( object rowObject, OLVColumn column ) : void

Put an indeterminate check into the check box at the given cell

CheckObject ( object modelObject ) : void

Mark the given object as checked in the list

CheckObjects ( IEnumerable modelObjects ) : void

Mark the given objects as checked in the list

CheckSubItem ( object rowObject, OLVColumn column ) : void

Put a check into the check box at the given cell

ClearHotItem ( ) : void

Force the hot item to be recalculated

ClearObjects ( ) : void

Remove all items from this list

ClearUrlVisited ( ) : void

Reset the memory of which URLs have been visited

ConfigureAutoComplete ( TextBox tb, OLVColumn column ) : void

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.

ConfigureAutoComplete ( TextBox tb, OLVColumn column, int maxRows ) : void

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.

CopyObjectsToClipboard ( IList objectsToCopy ) : void

Copy a text and html representation of the given objects onto the clipboard.

CopySelectionToClipboard ( ) : void

Copy a text and html representation of the selected rows onto the clipboard.

Be careful when using this with virtual lists. If the user has selected 10,000,000 rows, this method will faithfully try to copy all of them to the clipboard. From the user's point of view, your program will appear to have hung.

CreateColumnFilter ( ) : IModelFilter

Create a filter that will enact all the filtering currently installed on the visible columns.

DeselectAll ( ) : void

Deselect all rows in the listview

DropSinkCanDrop ( object sender, OlvDropEventArgs e ) : void
DropSinkDropped ( object sender, OlvDropEventArgs e ) : void
DropSinkModelCanDrop ( object sender, ModelDropEventArgs e ) : void
DropSinkModelDropped ( object sender, ModelDropEventArgs e ) : void
EditSubItem ( OLVListItem item, int subItemIndex ) : void

Begin an edit operation on the given cell.

This performs various sanity checks and passes off the real work to StartCellEdit().

EnableCustomSelectionColors ( ) : void

Setup the list so it will draw selected rows using custom colours.

This method makes the list owner drawn, and ensures that all columns have at least a BaseRender installed.

EnsureGroupVisible ( ListViewGroup lvg ) : void

Scroll the listview so that the given group is at the top.

If the group is already visible, the list will still be scrolled to move the group to the top, if that is possible.

This only works when the list is showing groups (obviously).

This does not work on virtual lists, since virtual lists don't use ListViewGroups for grouping. Use VirtualObjectListView.EnsureNthGroupVisible instead.

EnsureModelVisible ( Object modelObject ) : void

Ensure that the given model object is visible

EnumerableToArray ( IEnumerable collection, bool alwaysCreate ) : ArrayList

Convert the given enumerable into an ArrayList as efficiently as possible

When we move to .NET 3.5, we can use LINQ and not need this method.

FindMatchingRow ( string text, int start, SearchDirectionHint direction ) : int

Find the first row after the given start in which the text value in the comparison column begins with the given text. The comparison column is column 0, unless IsSearchOnSortColumn is true, in which case the current sort column is used.

The text comparison is a case-insensitive, prefix match. The search will search the every row until a match is found, wrapping at the end if needed.

FinishCellEdit ( ) : void

Finish the cell edit operation, writing changed data back to the model object

This method does not trigger a Validating event, so it always finishes the cell edit.

FinishCellEdit ( bool expectingCellEdit ) : void

Finish the cell edit operation, writing changed data back to the model object

This method does not trigger a Validating event, so it always finishes the cell edit.

Freeze ( ) : void

Freeze the listview so that it no longer updates itself.

Freeze()/Unfreeze() calls nest correctly

GetCellToolTip ( int columnIndex, int rowIndex ) : String

Return the tooltip that should be shown when the mouse is hovered over the given cell

GetColumn ( int index ) : OLVColumn

Return the column at the given index

GetColumn ( string name ) : OLVColumn

Return the column at the given title.

GetDisplayOrderOfItemIndex ( int itemIndex ) : int

Return the display index of the given listviewitem index. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetFilteredColumns ( View view ) : List

Return a collection of columns that are visible to the given view. Only Tile and Details have columns; all other views have 0 columns.

GetHeaderToolTip ( int columnIndex ) : String

Return the tooltip that should be shown when the mouse is hovered over the given column

GetItem ( int index ) : OLVListItem

Return the item at the given index

GetItemAt ( int x, int y, OLVColumn &hitColumn ) : OLVListItem

Find the item and column that are under the given co-ords

GetItemCount ( ) : int

Return the number of items in the list

GetLastItemInDisplayOrder ( ) : OLVListItem

Return the last item in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetModelObject ( int index ) : object

Return the model object at the given index

GetNextItem ( OLVListItem itemToFind ) : OLVListItem

Return the ListViewItem that appears immediately after the given item. If the given item is null, the first item in the list will be returned. Return null if the given item is the last item.

GetNthItemInDisplayOrder ( int n ) : OLVListItem

Return the n'th item (0-based) in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetPreviousItem ( OLVListItem itemToFind ) : OLVListItem

Return the ListViewItem that appears immediately before the given item. If the given item is null, the last item in the list will be returned. Return null if the given item is the first item.

GetSubItem ( int index, int columnIndex ) : OLVListSubItem

Return the sub item at the given index/column

HasDecoration ( IDecoration decoration ) : bool

Is the given decoration shown on this list

HasOverlay ( IOverlay overlay ) : bool

Is the given overlay shown on this list?

HideOverlays ( ) : void

Hide any overlays.

This is only a temporary hiding -- the overlays will be shown the next time the ObjectListView redraws.

HitTest ( int x, int y ) : ListViewHitTestInfo

Calculate what item is under the given point?

ISupportInitialize ( ) : void
IndexOf ( Object modelObject ) : int

Find the given model object within the listview and return its index

InsertObjects ( int index, ICollection modelObjects ) : void

Insert the given collection of objects before the given position

This operation only makes sense of non-sorted, non-grouped lists, since any subsequent sort/group operation will rearrange the list.

This method only works on ObjectListViews and FastObjectListViews.

IsChecked ( object modelObject ) : bool

Return true of the given object is checked

If the given object is not in the list, this method returns false.

IsCheckedIndeterminate ( object modelObject ) : bool

Return true of the given object is indeterminately checked

If the given object is not in the list, this method returns false.

IsEnumerableEmpty ( IEnumerable collection ) : bool
IsSelected ( object model ) : bool

Return true if the row representing the given model is selected

IsSubItemChecked ( object rowObject, OLVColumn column ) : bool

Is there a check at the check box at the given cell

IsUrlVisited ( string url ) : bool

Has the given URL been visited?

MakeColumnCommandMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown

Append the column selection menu items to the given menu strip.

MakeColumnSelectMenu ( ToolStripDropDown strip ) : ToolStripDropDown

Append the column selection menu items to the given menu strip.

MakeFilteringMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown

Create a Filtering menu

MarkUrlVisited ( string url ) : void

Remember that the given URL has been visited

This does not cause the control be redrawn

ModelToItem ( object modelObject ) : OLVListItem

Return the OLVListItem that displays the given model object

This method has O(n) performance.

MoveObjects ( int index, ICollection modelObjects ) : void

Move the given collection of objects to the given index.

This operation only makes sense on non-grouped ObjectListViews.

ObjectListView ( ) : System

Create an ObjectListView

ObjectsToHtml ( IList objectsToConvert ) : string

Return a html representation of the given objects

OlvHitTest ( int x, int y ) : OlvListViewHitTestInfo

What is under the given point? This takes the various parts of a cell into accout, including any custom parts that a custom renderer might use

PauseAnimations ( bool isPause ) : void

Pause (or unpause) all animations in the list

PossibleFinishCellEditing ( ) : bool

If a cell edit is in progress, finish the edit.

This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.

PossibleFinishCellEditing ( bool expectingCellEdit ) : bool

If a cell edit is in progress, finish the edit.

This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.

RebuildColumns ( ) : void

Rebuild the columns based upon its current view and column visibility settings

RefreshHotItem ( ) : void

Force the hot item to be recalculated

RefreshItem ( OLVListItem olvi ) : void

Update the ListViewItem with the data from its associated model.

This method does not resort or regroup the view. It simply updates the displayed data of the given item

RefreshObject ( object modelObject ) : void

Update the rows that are showing the given objects

This method does not resort or regroup the view.

RefreshObjects ( IList modelObjects ) : void

Update the rows that are showing the given objects

This method does not resort or regroup the view.

This method can safely be called from background threads.

RefreshOverlay ( IOverlay overlay ) : void

Refresh the display of just one overlays

RefreshOverlays ( ) : void

Refresh the display of the overlays

RefreshSelectedObjects ( ) : void

Update the rows that are selected

This method does not resort or regroup the view.

RemoveDecoration ( IDecoration decoration ) : void

Remove the given decoration from this list

RemoveObject ( object modelObject ) : void

Remove the given model object from the ListView

See RemoveObjects() for more details

This method is thread-safe.

RemoveObjects ( ICollection modelObjects ) : void

Remove all of the given objects from the control.

Nulls and model objects that are not in the ListView are silently ignored.

This method is thread-safe.

RemoveOverlay ( IOverlay overlay ) : void

Remove the given overlay to those on this list

Reset ( ) : void

Make the list forget everything -- all rows and all columns

Use ClearObjects if you want to remove just the rows.

ResetColumnFiltering ( ) : void

Remove all column filtering.

RestoreState ( byte state ) : bool

Restore the state of the control from the given string, which must have been produced by SaveState()

SaveState ( ) : byte[]

Return a byte array that represents the current state of the ObjectListView, such that the state can be restored by RestoreState()

The state of an ObjectListView includes the attributes that the user can modify: current view (i.e. Details, Tile, Large Icon...) sort column and direction column order column widths column visibility

It does not include selection or the scroll position.

SelectAll ( ) : void

Select all rows in the listview

SelectObject ( object modelObject ) : void

Select the row that is displaying the given model object, in addition to any current selection.

Use the SelectedObject property to deselect all other rows

SelectObject ( object modelObject, bool setFocus ) : void

Select the row that is displaying the given model object, in addition to any current selection.

Use the SelectedObject property to deselect all other rows

SelectObjects ( IList modelObjects ) : void

Select the rows that is displaying any of the given model object. All other rows are deselected.

SetNativeBackgroundImage ( Image image, int xOffset, int yOffset ) : void

Set the given image to be background of the ListView so that it appears at the given percentage offsets within the list.

This has the same limitations as described in SetNativeBackgroundWatermark. Make sure those limitations are understood before using the method.

This is very similar to setting the System.Windows.Forms.Control.BackgroundImage property of the standard .NET ListView, except that the standard BackgroundImage does not handle images with transparent areas properly -- it renders transparent areas as black. This method does not have that problem.

Setting this clears any background watermark.

SetNativeBackgroundTiledImage ( Image image ) : void

Set the given image to be the tiled background of the ListView.

This has the same limitations as described in SetNativeBackgroundWatermark and SetNativeBackgroundImage. Make sure those limitations are understood before using the method.

SetNativeBackgroundWatermark ( Image image ) : void

Set the given image to be fixed in the bottom right of the list view. This image will not scroll when the list view scrolls.

This method uses ListView's native ability to display a background image. It has a few limitations:

It doesn't work well with owner drawn mode. In owner drawn mode, each cell draws itself, including its background, which covers the background image. It doesn't look very good when grid lines are enabled, since the grid lines are drawn over the image. It does not work at all on XP. Obviously, it doesn't look good when alternate row background colors are enabled.

If you can live with these limitations, native watermarks are quite neat. They are true backgrounds, not translucent overlays like the OverlayImage uses. They also have the decided advantage over overlays in that they work correctly even in MDI applications.

Setting this clears any background image.

SetObjects ( IEnumerable collection ) : void

Set the collection of objects that will be shown in this list view.

The list is updated immediately

SetObjects ( IEnumerable collection, bool preserveState ) : void

Set the collection of objects that will be shown in this list view.

The list is updated immediately

SetSubItemImage ( int rowIndex, int subItemIndex, OLVListSubItem subItem, bool shouldClearImages ) : void

Set the subitem image natively

SetupSubItemCheckBoxes ( ) : void

Setup this control so it can display check boxes on subitems (or primary checkboxes in virtual mode)

This gives the ListView a small image list, if it doesn't already have one.

ShowOverlays ( ) : void

Make sure that any overlays are visible.

ShowSortIndicator ( ) : void

Put a sort indicator next to the text of the sort column

Sort ( ) : void

Sort the items by the last sort column and order

Sort ( OLVColumn columnToSort ) : void

Sort the items in the list view by the values in the given column and the last sort order

Sort ( OLVColumn columnToSort, SortOrder order ) : void

Sort the items in the list view by the values in the given column and by the given order.

If ShowGroups is true, the rows will be grouped by the given column. If AlwaysGroupsByColumn is not null, the rows will be grouped by that column, and the rows within each group will be sorted by the given column.

Sort ( int columnToSortIndex ) : void

Sort the items in the list view by the values in the given column and the last sort order

Sort ( string columnToSortName ) : void

Sort the items in the list view by the values in the given column and the last sort order

StartCellEdit ( OLVListItem item, int subItemIndex ) : void

Really start an edit operation on a given cell. The parameters are assumed to be sane.

ToggleCheckObject ( object modelObject ) : void

Toggle the checkedness of the given object. A checked object becomes unchecked; an unchecked or indeterminate object becomes checked. If the list has tristate checkboxes, the order is: unchecked -> checked -> indeterminate -> unchecked ...

ToggleSubItemCheckBox ( object rowObject, OLVColumn column ) : void

Toggle the check at the check box of the given cell

UncheckObject ( object modelObject ) : void

Mark the given object as unchecked in the list

UncheckObjects ( IEnumerable modelObjects ) : void

Mark the given objects as unchecked in the list

UncheckSubItem ( object rowObject, OLVColumn column ) : void

Uncheck the check at the given cell

Unfreeze ( ) : void

Unfreeze the listview. If this call is the outermost Unfreeze(), the contents of the listview will be rebuilt.

Freeze()/Unfreeze() calls nest correctly

Unsort ( ) : void

Remove any sorting and revert to the given order of the model objects

UpdateColumnFiltering ( ) : void

Update the filtering of this ObjectListView based on the value filtering defined in each column

Защищенные методы

Метод Описание
AddItemsToColumnSelectMenu ( ToolStripItemCollection items ) : void

Create the menu items that will allow columns to be choosen and add them to the given collection

ApplyCellStyle ( BrightIdeasSoftware.OLVListItem olvi, int columnIndex, IItemStyle style ) : void

Apply a style to a cell

ApplyExtendedStyles ( ) : void

Apply all required extended styles to our control.

Whenever .NET code sets an extended style, it erases all other extended styles that it doesn't use. So, we have to explicit reapply the styles that we have added.

Normally, we would override CreateParms property and update the ExStyle member, but ListView seems to ignore all ExStyles that it doesn't already know about. Worse, when we set the LVS_EX_HEADERINALLVIEWS value, bad things happen (the control crashes!).

ApplyRowStyle ( BrightIdeasSoftware.OLVListItem olvi, IItemStyle style ) : void

Apply a style to the given row

CalculateCellEditorBoundsOwnerDrawn ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column, when the listview is being owner drawn.

CalculateCellEditorBoundsStandard ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle cellBounds, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column, when the listview is not being owner drawn.

CalculateOwnerDrawnHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void

Perform a hit test when the control is owner drawn. This hands off responsibility to the renderer.

CalculateStandardHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void

Perform a hit test when the control is not owner drawn

CellEditor_Validating ( object sender, CancelEventArgs e ) : void

Called when the cell editor could be about to lose focus. Time to commit the change

CleanupCellEdit ( bool expectingCellEdit ) : void

Remove all trace of any existing cell edit operation

ClearPersistentCheckState ( ) : void

Forget any persistent checkbox state

CollectGroupingParameters ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : BrightIdeasSoftware.GroupingParameters

Collect and return all the variables that influence the creation of groups

ConfigureControl ( ) : void

Setup the given control to be a cell editor

CorrectSubItemColors ( ListViewItem olvi ) : void

For some reason, UseItemStyleForSubItems doesn't work for the colors when owner drawing the list, so we have to specifically give each subitem the desired colors

Cells drawn via BaseRenderer don't need this, but it is needed when an owner drawn cell uses DrawDefault=true

CreateCellToolTip ( ) : void

Create a ToolTipControl to manage the tooltip control used by the listview control

CreateGroups ( IEnumerable groups ) : void

Do the actual work of creating the given list of groups

Dispose ( bool disposing ) : void

Dispose of any resources this instance has been using

DoUnfreeze ( ) : void

Do the actual work required when the listview is unfrozen

DrawAllDecorations ( Graphics g, List drawnItems ) : void

Draw all the decorations

FillInValues ( OLVListItem lvi, object rowObject ) : void

Fill in the given OLVListItem with values of the given row

FilterObjects ( IEnumerable originalObjects, IModelFilter aModelFilter, IListFilter aListFilter ) : IEnumerable

Do the actual work of filtering

FindMatchInRange ( string text, int first, int last, OLVColumn column ) : int

Find the first row in the given range of rows that prefix matches the string value of the given column.

ForceSubItemImagesExStyle ( ) : void

Make sure the ListView has the extended style that says to display subitem images.

This method must be called after any .NET call that update the extended styles since they seem to erase this setting.

GetActualImageIndex ( Object imageSelector ) : int

Convert the given image selector to an index into our image list. Return -1 if that's not possible

GetCellEditor ( OLVListItem item, int subItemIndex ) : Control

Return a control that can be used to edit the value of the given cell.

GetCheckState ( Object modelObject ) : CheckState?

Get the checkedness of an object from the model. Returning null means the model does not know and the value from the control will be used.

GetControlValue ( Control control ) : Object

Return the value that the given control is showing

GetPersistentCheckState ( object model ) : CheckState

Gets the checkedness of the given model.

HandleApplicationIdle ( object sender, EventArgs e ) : void

The application is idle. Trigger a SelectionChanged event.

HandleApplicationIdleResizeColumns ( object sender, EventArgs e ) : void

The application is idle. Trigger a SelectionChanged event.

HandleBeginScroll ( Message &m ) : bool

Handle the BeginScroll listview notification

HandleCellToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void

The cell tooltip control wants information about the tool tip that it should show.

HandleChar ( Message &m ) : bool

Handle the search for item m if possible.

HandleColumnClick ( object sender, ColumnClickEventArgs e ) : void

Event handler for the column click event

HandleColumnWidthChanged ( object sender, ColumnWidthChangedEventArgs e ) : void

When the column widths change, resize the space filling columns

HandleColumnWidthChanging ( object sender, ColumnWidthChangingEventArgs e ) : void

When the column widths are changing, resize the space filling columns

HandleContextMenu ( Message &m ) : bool

The user wants to see the context menu.

We want to ignore context menu requests that are triggered by right clicks on the header

HandleCustomDraw ( Message &m ) : bool

Handle the Custom draw series of notifications

HandleDestroy ( Message &m ) : bool

Handle the underlying control being destroyed

HandleEndScroll ( Message &m ) : bool

Handle the EndScroll listview notification

HandleFindItem ( Message &m ) : bool

Handle the search for item m if possible.

HandleGroupInfo ( Message &m ) : bool

Handle the Group Info series of notifications

HandleHeaderRightClick ( int columnIndex ) : bool

The user has right clicked on the column headers. Do whatever is required

HandleHeaderToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void

The header tooltip control wants information about the tool tip that it should show.

HandleKeyDown ( Message &m ) : bool

Handle a key down message

HandleLButtonDoubleClick ( Message &m ) : bool

Catch the Left Button double click event.

HandleLButtonDown ( Message &m ) : bool

Catch the Left Button down event.

HandleLButtonUp ( Message &m ) : bool

Catch the Left Button up event.

HandleLayout ( object sender, LayoutEventArgs e ) : void

When the size of the control changes, we have to resize our space filling columns.

HandleLinkClick ( Message &m ) : bool

Handle the LinkClick listview notification

HandleMouseMove ( Message &m ) : bool

Catch the MouseMove event.

HandleNotify ( Message &m ) : bool

In the notification messages, we handle attempts to change the width of our columns

HandlePaint ( Message &m ) : bool

Handle the WM_PAINT event

HandlePostPaint ( ) : void

Perform any steps needed after painting the control

HandlePrePaint ( ) : void

Perform any steps needed before painting the control

HandleRButtonDoubleClick ( Message &m ) : bool

Catch the right Button double click event.

HandleRButtonDown ( Message &m ) : bool

Catch the Right Button down event.

HandleReflectNotify ( Message &m ) : bool

Handle notifications that have been reflected back from the parent window

HandleWindowPosChanging ( Message &m ) : bool

Handle the window position changing.

InitializeCheckBoxImages ( ) : void

Make sure the small image list for this control has checkbox images (used for sub-item checkboxes).

This gives the ListView a small image list, if it doesn't already have one.

InitializeEmptyListMsgOverlay ( ) : void

Create and configure the empty list msg overlay

InitializeStandardOverlays ( ) : void

Initialize the standard image and text overlays

InitializeStateImageList ( ) : void

Initialize the state image list with the required checkbox images

LowLevelHitTest ( int x, int y ) : OlvListViewHitTestInfo

Perform a hit test using the Windows control's SUBITEMHITTEST message. This provides information about group hits that the standard ListView.HitTest() does not.

MakeDefaultCellEditor ( OLVColumn column ) : Control

Return a TextBox that can be used as a default cell editor.

MakeGroups ( GroupingParameters parms ) : IList

Make a list of groups that should be shown according to the given parameters

This should not change the state of the control. It is possible that the groups created will not be used. They may simply be discarded.

MakeHeaderRightClickMenu ( int columnIndex ) : ToolStripDropDown

Create the menu that should be displayed when the user right clicks on the given column header.

MakeSortIndicatorImages ( ) : void

If the sort indicator images don't already exist, this method will make and install them

OnColumnReordered ( ColumnReorderedEventArgs e ) : void

Override the OnColumnReordered method to do what we want

OnControlCreated ( ) : void

This method is called after the control has been fully created.

OnDragDrop ( DragEventArgs args ) : void

OnDragEnter ( DragEventArgs args ) : void

OnDragLeave ( EventArgs e ) : void

OnDragOver ( DragEventArgs args ) : void

OnDrawColumnHeader ( DrawListViewColumnHeaderEventArgs e ) : void

Owner draw the column header

OnDrawItem ( DrawListViewItemEventArgs e ) : void

Owner draw the item

OnDrawSubItem ( DrawListViewSubItemEventArgs e ) : void

Owner draw a single subitem

OnGiveFeedback ( GiveFeedbackEventArgs args ) : void

OnHandleCreated ( EventArgs e ) : void

Called when the handle of the underlying control is created

OnItemDrag ( ItemDragEventArgs e ) : void

OnMouseDown ( MouseEventArgs e ) : void

We need the click count in the mouse up event, but that is always 1. So we have to remember the click count from the preceding mouse down event.

OnMouseLeave ( EventArgs e ) : void

When the mouse leaves the control, remove any hot item highlighting

OnMouseMove ( MouseEventArgs e ) : void

When the mouse moves, we might need to change the hot item.

OnMouseUp ( MouseEventArgs e ) : void

Check to see if we need to start editing a cell

OnQueryContinueDrag ( QueryContinueDragEventArgs args ) : void

OnRightMouseUp ( MouseEventArgs e ) : void

The user right clicked on the control

OnSelectedIndexChanged ( EventArgs e ) : void

This method is called every time a row is selected or deselected. This can be a pain if the user shift-clicks 100 rows. We override this method so we can trigger one event for any number of select/deselects that come from one user action

PostProcessOneRow ( int rowIndex, int displayIndex, OLVListItem olvi ) : void

Do the work required after one item in a listview have been created

PostProcessRows ( ) : void

Do the work required after the items in a listview have been created

ProcessDialogKey ( Keys keyData ) : bool

Handle a key press on this control. We specifically look for F2 which edits the primary column, or a Tab character during an edit operation, which tries to start editing on the next (or previous) cell.

ProcessHyperlinkClicked ( CellClickEventArgs e ) : void

Tell the world that a hyperlink was clicked and if the event isn't handled, do the default processing.

ProcessLButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool

Handle a mouse double click at the given hit test location

Subclasses can override this to do something unique

ProcessLButtonDown ( OlvListViewHitTestInfo hti ) : bool

Handle a left mouse down at the given hit test location

Subclasses can override this to do something unique

ProcessRButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool

Handle a right mouse double click at the given hit test location

Subclasses can override this to do something unique

ProcessRButtonDown ( OlvListViewHitTestInfo hti ) : bool

Handle a left mouse down at the given hit test location

Subclasses can override this to do something unique

PutCheckState ( Object modelObject, CheckState state ) : CheckState

Record the change of checkstate for the given object in the model. This does not update the UI -- only the model

ResizeFreeSpaceFillingColumns ( ) : void

Resize our space filling columns so they fill any unoccupied width in the control

ResizeFreeSpaceFillingColumns ( int freeSpace ) : void

Resize our space filling columns so they fill any unoccupied width in the control

SetControlValue ( Control control, Object value, String stringValue ) : void

Try to give the given value to the provided control. Fall back to assigning a string if the value assignment fails.

SetObjectCheckedness ( object modelObject, CheckState state ) : void

Change the check state of the given object to be the given state.

If the given model object isn't in the list, we still try to remember its state, in case it is referenced in the future.

SetPersistentCheckState ( object model, CheckState state ) : CheckState

Remember the check state of the given model object

SetSubItemImages ( int rowIndex, OLVListItem item ) : void

Tell the underlying list control which images to show against the subitems

SetSubItemImages ( int rowIndex, OLVListItem item, bool shouldClearImages ) : void

Tell the underlying list control which images to show against the subitems

ShouldStartCellEdit ( MouseEventArgs e ) : bool

Should we start editing the cell in response to the given mouse button event?

ShowHeaderRightClickMenu ( int columnIndex, Point pt ) : bool

Show a menu that is appropriate when the given column header is clicked.

ShowSortIndicator ( OLVColumn columnToSort, SortOrder sortOrder ) : void

Put a sort indicator next to the text of the given given column

StandardHyperlinkClickedProcessing ( HyperlinkClickedEventArgs args ) : void

Do the default processing for a hyperlink clicked event, which is to try and open the url.

TakeOwnershipOfObjects ( ) : void

Take ownership of the 'objects' collection. This separats our collection from the source.

This method separates the 'objects' instance variable from its source, so that any AddObject/RemoveObject calls will modify our collection and not the original colleciton.

This method has the intentional side-effect of converting our list of objects to an ArrayList.

TriggerFormatRowEvent ( int rowIndex, int displayIndex, OLVListItem olvi ) : void

Trigger FormatRow and possibly FormatCell events for the given item

TriggerGroupExpandCollapse ( OLVGroup group ) : bool

Trigger a GroupExpandCollapse event and return true if the action was cancelled

UnapplyHotItem ( int index ) : void

Remove hot item styling from the given row

UpdateCellToolTipHandle ( ) : void

Update the handle used by our cell tooltip to be the tooltip used by the underlying Windows listview control.

UpdateFiltering ( ) : void

When some setting related to filtering changes, this method is called.

UpdateHotItem ( OlvListViewHitTestInfo hti ) : void

The mouse has moved to the given pt. See if the hot item needs to be updated

This is the main entry point for hot item handling

UpdateHotItem ( Point pt ) : void

The mouse has moved to the given pt. See if the hot item needs to be updated

This is the main entry point for hot item handling

UpdateHotRow ( OLVListItem olvi ) : void

Update the given row using the current hot item information

UpdateHotRow ( int rowIndex, int columnIndex, HitTestLocation hitLocation, OLVListItem olvi ) : void

Update the given row using the given hot item information

UpdateNotificationSubscriptions ( IEnumerable collection ) : void

Change any subscriptions to INotifyPropertyChanged events on our current model objects so that we no longer listen for events on the old models and do listen for events on the given collection.

This does nothing if UseNotifyPropertyChanged is false.

WndProc ( Message &m ) : void

Override the basic message pump for this control

Приватные методы

Метод Описание
AddCheckStateBitmap ( ImageList il, string key, CheckBoxState boxState ) : void
ApplyHyperlinkStyle ( int rowIndex, BrightIdeasSoftware.OLVListItem olvi ) : void
BuildBeforeSortingEventArgs ( OLVColumn column, SortOrder order ) : BrightIdeasSoftware.BeforeSortingEventArgs
BuildCellEvent ( BrightIdeasSoftware.CellEventArgs args, Point location ) : void
CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, ItemBoundsPortion portion ) : Rectangle
CalculateCheckState ( int state ) : CheckState
CalculateToggledCheckState ( OLVColumn column, CheckState currentState ) : CheckState
ColumnSelectMenuClosing ( object sender, System.Windows.Forms.ToolStripDropDownClosingEventArgs e ) : void
ColumnSelectMenuItemClicked ( object sender, ToolStripItemClickedEventArgs e ) : void
DoSort ( OLVColumn columnToSort, SortOrder order ) : void
FindGlassPanelForOverlay ( IOverlay overlay ) : GlassPanelForm
GetCheckedObject ( ) : object
GetCheckedObjects ( ) : ArrayList
GetFirstNonNullValue ( OLVColumn column ) : object

Get the first non-null value of the given column. At most 1000 rows will be considered.

GetSelectedObject ( ) : object
GetSelectedObjects ( ) : ArrayList
HandleHeaderRightClick ( ) : bool
HandleModelOnPropertyChanged ( object sender, PropertyChangedEventArgs propertyChangedEventArgs ) : void
HeaderToolTipShowingCallback ( object sender, ToolTipShowingEventArgs e ) : void

Allow the HeaderControl to call back into HandleHeaderToolTipShowing without making that method public

LowLevelScroll ( int dx, int dy ) : void

Scroll the ListView by the given deltas.

MakeResizedImage ( int width, int height, Image image, Color transparent ) : Bitmap

Return a bitmap of the given height x height, which shows the given image, centred.

MakeResizedImageList ( int width, int height, ImageList source ) : ImageList

Return a copy of the given source image list, where each image has been resized to be height x height in size. If source is null, an empty image list of the given size is returned

MakeSubItem ( object rowObject, OLVColumn column ) : OLVListSubItem
MakeTriangleBitmap ( Size sz, Point pts ) : Bitmap
PrepareAlternateBackColors ( ) : void
RememberDisplayIndicies ( ) : void
RunWhenIdle ( EventHandler eventHandler ) : void
SetAllSubItemImages ( ) : void
SetGroupSpacing ( ) : void
SetupBaseImageList ( ) : void

Update our externally visible image list so it holds the same images as our shadow list, but sized correctly

ShouldShowOverlays ( ) : bool
ShowColumnCommandMenu ( int columnIndex, Point pt ) : void
ShowColumnSelectMenu ( Point pt ) : void
StateToString ( uint state ) : string
SubscribeNotifications ( IEnumerable models ) : void
ToggleSelectedRowCheckBoxes ( ) : void
UnsubscribeNotifications ( IEnumerable models ) : void

Описание методов

AddDecoration() публичный Метод

Add the given decoration to those on this list and make it appear
A decoration scrolls with the listview. An overlay stays fixed in place.
public AddDecoration ( IDecoration decoration ) : void
decoration IDecoration The decoration
Результат void

AddItemsToColumnSelectMenu() защищенный Метод

Create the menu items that will allow columns to be choosen and add them to the given collection
protected AddItemsToColumnSelectMenu ( ToolStripItemCollection items ) : void
items System.Windows.Forms.ToolStripItemCollection
Результат void

AddObject() публичный Метод

Add the given model object to this control.
See AddObjects() for more details
public AddObject ( object modelObject ) : void
modelObject object The model object to be displayed
Результат void

AddObjects() публичный Метод

Add the given collection of model objects to this control.

The added objects will appear in their correct sort position, if sorting is active (i.e. if LastSortColumn is not null). Otherwise, they will appear at the end of the list.

No check is performed to see if any of the objects are already in the ListView.

Null objects are silently ignored.

public AddObjects ( ICollection modelObjects ) : void
modelObjects ICollection A collection of model objects
Результат void

AddOverlay() публичный Метод

Add the given overlay to those on this list and make it appear
public AddOverlay ( IOverlay overlay ) : void
overlay IOverlay The overlay
Результат void

ApplyCellStyle() защищенный Метод

Apply a style to a cell
protected ApplyCellStyle ( BrightIdeasSoftware.OLVListItem olvi, int columnIndex, IItemStyle style ) : void
olvi BrightIdeasSoftware.OLVListItem
columnIndex int
style IItemStyle
Результат void

ApplyExtendedStyles() защищенный Метод

Apply all required extended styles to our control.

Whenever .NET code sets an extended style, it erases all other extended styles that it doesn't use. So, we have to explicit reapply the styles that we have added.

Normally, we would override CreateParms property and update the ExStyle member, but ListView seems to ignore all ExStyles that it doesn't already know about. Worse, when we set the LVS_EX_HEADERINALLVIEWS value, bad things happen (the control crashes!).

protected ApplyExtendedStyles ( ) : void
Результат void

ApplyRowStyle() защищенный Метод

Apply a style to the given row
protected ApplyRowStyle ( BrightIdeasSoftware.OLVListItem olvi, IItemStyle style ) : void
olvi BrightIdeasSoftware.OLVListItem
style IItemStyle
Результат void

AutoResizeColumns() публичный Метод

Resize the columns to the maximum of the header width and the data.
public AutoResizeColumns ( ) : void
Результат void

BuildGroups() публичный Метод

Organise the view items into groups, based on the last sort column or the first column if there is no last sort column
public BuildGroups ( ) : void
Результат void

BuildGroups() публичный Метод

Organise the view items into groups, based on the given column

If the AlwaysGroupByColumn property is not null, the list view items will be organisd by that column, and the 'column' parameter will be ignored.

This method triggers sorting events: BeforeSorting and AfterSorting.

public BuildGroups ( OLVColumn column, SortOrder order ) : void
column OLVColumn The column whose values should be used for sorting.
order SortOrder
Результат void

BuildGroups() публичный Метод

Organise the view items into groups, based on the given columns
This method does not trigger sorting events. Use BuildGroups() to do that
public BuildGroups ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : void
groupByColumn OLVColumn What column will be used for grouping
groupByOrder SortOrder What ordering will be used for groups
column OLVColumn The column whose values should be used for sorting. Cannot be null
order SortOrder The order in which the values from column will be sorted
secondaryColumn OLVColumn When the values from 'column' are equal, use the values provided by this column
secondaryOrder SortOrder How will the secondary values be sorted
Результат void

BuildList() публичный Метод

Build/rebuild all the list view items in the list, preserving as much state as is possible
public BuildList ( ) : void
Результат void

BuildList() публичный Метод

Build/rebuild all the list view items in the list

Use this method in situations were the contents of the list is basically the same as previously.

public BuildList ( bool shouldPreserveState ) : void
shouldPreserveState bool If this is true, the control will try to preserve the selection, /// focused item, and the scroll position (see Remarks) ///
Результат void

CalculateCellBounds() публичный Метод

Return the bounds of the given cell
public CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle
item BrightIdeasSoftware.OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Результат System.Drawing.Rectangle

CalculateCellEditorBounds() публичный Метод

Calculate the bounds of the edit control for the given item/column
public CalculateCellEditorBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
preferredSize System.Drawing.Size
Результат System.Drawing.Rectangle

CalculateCellEditorBoundsOwnerDrawn() защищенный Метод

Calculate the bounds of the edit control for the given item/column, when the listview is being owner drawn.
protected CalculateCellEditorBoundsOwnerDrawn ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
r System.Drawing.Rectangle
preferredSize System.Drawing.Size
Результат System.Drawing.Rectangle

CalculateCellEditorBoundsStandard() защищенный Метод

Calculate the bounds of the edit control for the given item/column, when the listview is not being owner drawn.
protected CalculateCellEditorBoundsStandard ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle cellBounds, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
cellBounds System.Drawing.Rectangle
preferredSize System.Drawing.Size
Результат System.Drawing.Rectangle

CalculateCellTextBounds() публичный Метод

Return the bounds of the given cell only until the edge of the current text
public CalculateCellTextBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle
item BrightIdeasSoftware.OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Результат System.Drawing.Rectangle

CalculateOwnerDrawnHitTest() защищенный Метод

Perform a hit test when the control is owner drawn. This hands off responsibility to the renderer.
protected CalculateOwnerDrawnHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void
hti BrightIdeasSoftware.OlvListViewHitTestInfo
x int
y int
Результат void

CalculateReasonableTileSize() публичный Метод

Give the listview a reasonable size of its tiles, based on the number of lines of information that each tile is going to display.
public CalculateReasonableTileSize ( ) : void
Результат void

CalculateStandardHitTest() защищенный Метод

Perform a hit test when the control is not owner drawn
protected CalculateStandardHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void
hti BrightIdeasSoftware.OlvListViewHitTestInfo
x int
y int
Результат void

CancelCellEdit() публичный Метод

Stop editing a cell and throw away any changes.
public CancelCellEdit ( ) : void
Результат void

CellEditor_Validating() защищенный Метод

Called when the cell editor could be about to lose focus. Time to commit the change
protected CellEditor_Validating ( object sender, CancelEventArgs e ) : void
sender object
e CancelEventArgs
Результат void

ChangeToFilteredColumns() публичный Метод

Rebuild this list for the given view
public ChangeToFilteredColumns ( View view ) : void
view View
Результат void

CheckIndeterminateObject() публичный Метод

Mark the given object as indeterminate check state
public CheckIndeterminateObject ( object modelObject ) : void
modelObject object The model object to be marked indeterminate
Результат void

CheckIndeterminateSubItem() публичный Метод

Put an indeterminate check into the check box at the given cell
public CheckIndeterminateSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Результат void

CheckObject() публичный Метод

Mark the given object as checked in the list
public CheckObject ( object modelObject ) : void
modelObject object The model object to be checked
Результат void

CheckObjects() публичный Метод

Mark the given objects as checked in the list
public CheckObjects ( IEnumerable modelObjects ) : void
modelObjects IEnumerable The model object to be checked
Результат void

CheckSubItem() публичный Метод

Put a check into the check box at the given cell
public CheckSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Результат void

CleanupCellEdit() защищенный Метод

Remove all trace of any existing cell edit operation
protected CleanupCellEdit ( bool expectingCellEdit ) : void
expectingCellEdit bool
Результат void

ClearHotItem() публичный Метод

Force the hot item to be recalculated
public ClearHotItem ( ) : void
Результат void

ClearObjects() публичный Метод

Remove all items from this list
public ClearObjects ( ) : void
Результат void

ClearPersistentCheckState() защищенный Метод

Forget any persistent checkbox state
protected ClearPersistentCheckState ( ) : void
Результат void

ClearUrlVisited() публичный Метод

Reset the memory of which URLs have been visited
public ClearUrlVisited ( ) : void
Результат void

CollectGroupingParameters() защищенный Метод

Collect and return all the variables that influence the creation of groups
protected CollectGroupingParameters ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : BrightIdeasSoftware.GroupingParameters
groupByColumn OLVColumn
groupByOrder SortOrder
column OLVColumn
order SortOrder
secondaryColumn OLVColumn
secondaryOrder SortOrder
Результат BrightIdeasSoftware.GroupingParameters

ConfigureAutoComplete() публичный Метод

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.
public ConfigureAutoComplete ( TextBox tb, OLVColumn column ) : void
tb System.Windows.Forms.TextBox The textbox to configure
column OLVColumn The column used to calculate values
Результат void

ConfigureAutoComplete() публичный Метод

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.
public ConfigureAutoComplete ( TextBox tb, OLVColumn column, int maxRows ) : void
tb System.Windows.Forms.TextBox The textbox to configure
column OLVColumn The column used to calculate values
maxRows int Consider only this many rows
Результат void

ConfigureControl() защищенный Метод

Setup the given control to be a cell editor
protected ConfigureControl ( ) : void
Результат void

CopyObjectsToClipboard() публичный Метод

Copy a text and html representation of the given objects onto the clipboard.
public CopyObjectsToClipboard ( IList objectsToCopy ) : void
objectsToCopy IList
Результат void

CopySelectionToClipboard() публичный Метод

Copy a text and html representation of the selected rows onto the clipboard.
Be careful when using this with virtual lists. If the user has selected 10,000,000 rows, this method will faithfully try to copy all of them to the clipboard. From the user's point of view, your program will appear to have hung.
public CopySelectionToClipboard ( ) : void
Результат void

CorrectSubItemColors() защищенный Метод

For some reason, UseItemStyleForSubItems doesn't work for the colors when owner drawing the list, so we have to specifically give each subitem the desired colors
Cells drawn via BaseRenderer don't need this, but it is needed when an owner drawn cell uses DrawDefault=true
protected CorrectSubItemColors ( ListViewItem olvi ) : void
olvi ListViewItem The item whose subitems are to be corrected
Результат void

CreateCellToolTip() защищенный Метод

Create a ToolTipControl to manage the tooltip control used by the listview control
protected CreateCellToolTip ( ) : void
Результат void

CreateColumnFilter() публичный Метод

Create a filter that will enact all the filtering currently installed on the visible columns.
public CreateColumnFilter ( ) : IModelFilter
Результат IModelFilter

CreateGroups() защищенный Метод

Do the actual work of creating the given list of groups
protected CreateGroups ( IEnumerable groups ) : void
groups IEnumerable
Результат void

DeselectAll() публичный Метод

Deselect all rows in the listview
public DeselectAll ( ) : void
Результат void

Dispose() защищенный Метод

Dispose of any resources this instance has been using
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

DoUnfreeze() защищенный Метод

Do the actual work required when the listview is unfrozen
protected DoUnfreeze ( ) : void
Результат void

DrawAllDecorations() защищенный Метод

Draw all the decorations
protected DrawAllDecorations ( Graphics g, List drawnItems ) : void
g Graphics A Graphics
drawnItems List The items that were redrawn and whose decorations should also be redrawn
Результат void

DropSinkCanDrop() публичный Метод

public DropSinkCanDrop ( object sender, OlvDropEventArgs e ) : void
sender object
e OlvDropEventArgs
Результат void

DropSinkDropped() публичный Метод

public DropSinkDropped ( object sender, OlvDropEventArgs e ) : void
sender object
e OlvDropEventArgs
Результат void

DropSinkModelCanDrop() публичный Метод

public DropSinkModelCanDrop ( object sender, ModelDropEventArgs e ) : void
sender object
e ModelDropEventArgs
Результат void

DropSinkModelDropped() публичный Метод

public DropSinkModelDropped ( object sender, ModelDropEventArgs e ) : void
sender object
e ModelDropEventArgs
Результат void

EditSubItem() публичный Метод

Begin an edit operation on the given cell.
This performs various sanity checks and passes off the real work to StartCellEdit().
public EditSubItem ( OLVListItem item, int subItemIndex ) : void
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Результат void

EnableCustomSelectionColors() публичный Метод

Setup the list so it will draw selected rows using custom colours.
This method makes the list owner drawn, and ensures that all columns have at least a BaseRender installed.
public EnableCustomSelectionColors ( ) : void
Результат void

EnsureGroupVisible() публичный Метод

Scroll the listview so that the given group is at the top.

If the group is already visible, the list will still be scrolled to move the group to the top, if that is possible.

This only works when the list is showing groups (obviously).

This does not work on virtual lists, since virtual lists don't use ListViewGroups for grouping. Use VirtualObjectListView.EnsureNthGroupVisible instead.

public EnsureGroupVisible ( ListViewGroup lvg ) : void
lvg ListViewGroup The group to be revealed
Результат void

EnsureModelVisible() публичный Метод

Ensure that the given model object is visible
public EnsureModelVisible ( Object modelObject ) : void
modelObject Object The model object to be revealed
Результат void

EnumerableToArray() публичный статический Метод

Convert the given enumerable into an ArrayList as efficiently as possible

When we move to .NET 3.5, we can use LINQ and not need this method.

public static EnumerableToArray ( IEnumerable collection, bool alwaysCreate ) : ArrayList
collection IEnumerable The source collection
alwaysCreate bool If true, this method will always create a new /// collection.
Результат ArrayList

FillInValues() защищенный Метод

Fill in the given OLVListItem with values of the given row
protected FillInValues ( OLVListItem lvi, object rowObject ) : void
lvi OLVListItem the OLVListItem that is to be stuff with values
rowObject object the model object from which values will be taken
Результат void

FilterObjects() защищенный Метод

Do the actual work of filtering
protected FilterObjects ( IEnumerable originalObjects, IModelFilter aModelFilter, IListFilter aListFilter ) : IEnumerable
originalObjects IEnumerable
aModelFilter IModelFilter
aListFilter IListFilter
Результат IEnumerable

FindMatchInRange() защищенный Метод

Find the first row in the given range of rows that prefix matches the string value of the given column.
protected FindMatchInRange ( string text, int first, int last, OLVColumn column ) : int
text string
first int
last int
column OLVColumn
Результат int

FindMatchingRow() публичный Метод

Find the first row after the given start in which the text value in the comparison column begins with the given text. The comparison column is column 0, unless IsSearchOnSortColumn is true, in which case the current sort column is used.
The text comparison is a case-insensitive, prefix match. The search will search the every row until a match is found, wrapping at the end if needed.
public FindMatchingRow ( string text, int start, SearchDirectionHint direction ) : int
text string The text to be prefix matched
start int The index of the first row to consider
direction SearchDirectionHint Which direction should be searched?
Результат int

FinishCellEdit() публичный Метод

Finish the cell edit operation, writing changed data back to the model object
This method does not trigger a Validating event, so it always finishes the cell edit.
public FinishCellEdit ( ) : void
Результат void

FinishCellEdit() публичный Метод

Finish the cell edit operation, writing changed data back to the model object
This method does not trigger a Validating event, so it always finishes the cell edit.
public FinishCellEdit ( bool expectingCellEdit ) : void
expectingCellEdit bool True if it is likely that another cell is going to be /// edited immediately after this cell finishes editing
Результат void

ForceSubItemImagesExStyle() защищенный Метод

Make sure the ListView has the extended style that says to display subitem images.
This method must be called after any .NET call that update the extended styles since they seem to erase this setting.
protected ForceSubItemImagesExStyle ( ) : void
Результат void

Freeze() публичный Метод

Freeze the listview so that it no longer updates itself.
Freeze()/Unfreeze() calls nest correctly
public Freeze ( ) : void
Результат void

GetActualImageIndex() защищенный Метод

Convert the given image selector to an index into our image list. Return -1 if that's not possible
protected GetActualImageIndex ( Object imageSelector ) : int
imageSelector Object
Результат int

GetCellEditor() защищенный Метод

Return a control that can be used to edit the value of the given cell.
protected GetCellEditor ( OLVListItem item, int subItemIndex ) : Control
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Результат Control

GetCellToolTip() публичный Метод

Return the tooltip that should be shown when the mouse is hovered over the given cell
public GetCellToolTip ( int columnIndex, int rowIndex ) : String
columnIndex int The column index whose tool tip is to be fetched
rowIndex int The row index whose tool tip is to be fetched
Результат String

GetCheckState() защищенный Метод

Get the checkedness of an object from the model. Returning null means the model does not know and the value from the control will be used.
protected GetCheckState ( Object modelObject ) : CheckState?
modelObject Object
Результат CheckState?

GetColumn() публичный Метод

Return the column at the given index
public GetColumn ( int index ) : OLVColumn
index int Index of the column to be returned
Результат OLVColumn

GetColumn() публичный Метод

Return the column at the given title.
public GetColumn ( string name ) : OLVColumn
name string Name of the column to be returned
Результат OLVColumn

GetControlValue() защищенный Метод

Return the value that the given control is showing
protected GetControlValue ( Control control ) : Object
control Control
Результат Object

GetDisplayOrderOfItemIndex() публичный Метод

Return the display index of the given listviewitem index. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetDisplayOrderOfItemIndex ( int itemIndex ) : int
itemIndex int
Результат int

GetFilteredColumns() публичный Метод

Return a collection of columns that are visible to the given view. Only Tile and Details have columns; all other views have 0 columns.
public GetFilteredColumns ( View view ) : List
view View Which view are the columns being calculate for?
Результат List

GetHeaderToolTip() публичный Метод

Return the tooltip that should be shown when the mouse is hovered over the given column
public GetHeaderToolTip ( int columnIndex ) : String
columnIndex int The column index whose tool tip is to be fetched
Результат String

GetItem() публичный Метод

Return the item at the given index
public GetItem ( int index ) : OLVListItem
index int Index of the item to be returned
Результат OLVListItem

GetItemAt() публичный Метод

Find the item and column that are under the given co-ords
public GetItemAt ( int x, int y, OLVColumn &hitColumn ) : OLVListItem
x int X co-ord
y int Y co-ord
hitColumn OLVColumn The column under the given point
Результат OLVListItem

GetItemCount() публичный Метод

Return the number of items in the list
public GetItemCount ( ) : int
Результат int

GetLastItemInDisplayOrder() публичный Метод

Return the last item in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetLastItemInDisplayOrder ( ) : OLVListItem
Результат OLVListItem

GetModelObject() публичный Метод

Return the model object at the given index
public GetModelObject ( int index ) : object
index int Index of the model object to be returned
Результат object

GetNextItem() публичный Метод

Return the ListViewItem that appears immediately after the given item. If the given item is null, the first item in the list will be returned. Return null if the given item is the last item.
public GetNextItem ( OLVListItem itemToFind ) : OLVListItem
itemToFind OLVListItem The item that is before the item that is returned, or null
Результат OLVListItem

GetNthItemInDisplayOrder() публичный Метод

Return the n'th item (0-based) in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetNthItemInDisplayOrder ( int n ) : OLVListItem
n int
Результат OLVListItem

GetPersistentCheckState() защищенный Метод

Gets the checkedness of the given model.
protected GetPersistentCheckState ( object model ) : CheckState
model object The model
Результат CheckState

GetPreviousItem() публичный Метод

Return the ListViewItem that appears immediately before the given item. If the given item is null, the last item in the list will be returned. Return null if the given item is the first item.
public GetPreviousItem ( OLVListItem itemToFind ) : OLVListItem
itemToFind OLVListItem The item that is before the item that is returned
Результат OLVListItem

GetSubItem() публичный Метод

Return the sub item at the given index/column
public GetSubItem ( int index, int columnIndex ) : OLVListSubItem
index int Index of the item to be returned
columnIndex int Index of the subitem to be returned
Результат OLVListSubItem

HandleApplicationIdle() защищенный Метод

The application is idle. Trigger a SelectionChanged event.
protected HandleApplicationIdle ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void

HandleApplicationIdleResizeColumns() защищенный Метод

The application is idle. Trigger a SelectionChanged event.
protected HandleApplicationIdleResizeColumns ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void

HandleBeginScroll() защищенный Метод

Handle the BeginScroll listview notification
protected HandleBeginScroll ( Message &m ) : bool
m Message
Результат bool

HandleCellToolTipShowing() защищенный Метод

The cell tooltip control wants information about the tool tip that it should show.
protected HandleCellToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void
sender object
e ToolTipShowingEventArgs
Результат void

HandleChar() защищенный Метод

Handle the search for item m if possible.
protected HandleChar ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleColumnClick() защищенный Метод

Event handler for the column click event
protected HandleColumnClick ( object sender, ColumnClickEventArgs e ) : void
sender object
e ColumnClickEventArgs
Результат void

HandleColumnWidthChanged() защищенный Метод

When the column widths change, resize the space filling columns
protected HandleColumnWidthChanged ( object sender, ColumnWidthChangedEventArgs e ) : void
sender object
e ColumnWidthChangedEventArgs
Результат void

HandleColumnWidthChanging() защищенный Метод

When the column widths are changing, resize the space filling columns
protected HandleColumnWidthChanging ( object sender, ColumnWidthChangingEventArgs e ) : void
sender object
e ColumnWidthChangingEventArgs
Результат void

HandleContextMenu() защищенный Метод

The user wants to see the context menu.
We want to ignore context menu requests that are triggered by right clicks on the header
protected HandleContextMenu ( Message &m ) : bool
m Message The windows m
Результат bool

HandleCustomDraw() защищенный Метод

Handle the Custom draw series of notifications
protected HandleCustomDraw ( Message &m ) : bool
m Message The message
Результат bool

HandleDestroy() защищенный Метод

Handle the underlying control being destroyed
protected HandleDestroy ( Message &m ) : bool
m Message
Результат bool

HandleEndScroll() защищенный Метод

Handle the EndScroll listview notification
protected HandleEndScroll ( Message &m ) : bool
m Message
Результат bool

HandleFindItem() защищенный Метод

Handle the search for item m if possible.
protected HandleFindItem ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleGroupInfo() защищенный Метод

Handle the Group Info series of notifications
protected HandleGroupInfo ( Message &m ) : bool
m Message The message
Результат bool

HandleHeaderRightClick() защищенный Метод

The user has right clicked on the column headers. Do whatever is required
protected HandleHeaderRightClick ( int columnIndex ) : bool
columnIndex int
Результат bool

HandleHeaderToolTipShowing() защищенный Метод

The header tooltip control wants information about the tool tip that it should show.
protected HandleHeaderToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void
sender object
e ToolTipShowingEventArgs
Результат void

HandleKeyDown() защищенный Метод

Handle a key down message
protected HandleKeyDown ( Message &m ) : bool
m Message
Результат bool

HandleLButtonDoubleClick() защищенный Метод

Catch the Left Button double click event.
protected HandleLButtonDoubleClick ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleLButtonDown() защищенный Метод

Catch the Left Button down event.
protected HandleLButtonDown ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleLButtonUp() защищенный Метод

Catch the Left Button up event.
protected HandleLButtonUp ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleLayout() защищенный Метод

When the size of the control changes, we have to resize our space filling columns.
protected HandleLayout ( object sender, LayoutEventArgs e ) : void
sender object
e LayoutEventArgs
Результат void

HandleLinkClick() защищенный Метод

Handle the LinkClick listview notification
protected HandleLinkClick ( Message &m ) : bool
m Message
Результат bool

HandleMouseMove() защищенный Метод

Catch the MouseMove event.
protected HandleMouseMove ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleNotify() защищенный Метод

In the notification messages, we handle attempts to change the width of our columns
protected HandleNotify ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandlePaint() защищенный Метод

Handle the WM_PAINT event
protected HandlePaint ( Message &m ) : bool
m Message
Результат bool

HandlePostPaint() защищенный Метод

Perform any steps needed after painting the control
protected HandlePostPaint ( ) : void
Результат void

HandlePrePaint() защищенный Метод

Perform any steps needed before painting the control
protected HandlePrePaint ( ) : void
Результат void

HandleRButtonDoubleClick() защищенный Метод

Catch the right Button double click event.
protected HandleRButtonDoubleClick ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleRButtonDown() защищенный Метод

Catch the Right Button down event.
protected HandleRButtonDown ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleReflectNotify() защищенный Метод

Handle notifications that have been reflected back from the parent window
protected HandleReflectNotify ( Message &m ) : bool
m Message The m to be processed
Результат bool

HandleWindowPosChanging() защищенный Метод

Handle the window position changing.
protected HandleWindowPosChanging ( Message &m ) : bool
m Message The m to be processed
Результат bool

HasDecoration() публичный Метод

Is the given decoration shown on this list
public HasDecoration ( IDecoration decoration ) : bool
decoration IDecoration The overlay
Результат bool

HasOverlay() публичный Метод

Is the given overlay shown on this list?
public HasOverlay ( IOverlay overlay ) : bool
overlay IOverlay The overlay
Результат bool

HideOverlays() публичный Метод

Hide any overlays.
This is only a temporary hiding -- the overlays will be shown the next time the ObjectListView redraws.
public HideOverlays ( ) : void
Результат void

HitTest() публичный Метод

Calculate what item is under the given point?
public HitTest ( int x, int y ) : ListViewHitTestInfo
x int
y int
Результат ListViewHitTestInfo

ISupportInitialize() публичный Метод

public ISupportInitialize ( ) : void
Результат void

IndexOf() публичный Метод

Find the given model object within the listview and return its index
public IndexOf ( Object modelObject ) : int
modelObject Object The model object to be found
Результат int

InitializeCheckBoxImages() защищенный Метод

Make sure the small image list for this control has checkbox images (used for sub-item checkboxes).
This gives the ListView a small image list, if it doesn't already have one.
protected InitializeCheckBoxImages ( ) : void
Результат void

InitializeEmptyListMsgOverlay() защищенный Метод

Create and configure the empty list msg overlay
protected InitializeEmptyListMsgOverlay ( ) : void
Результат void

InitializeStandardOverlays() защищенный Метод

Initialize the standard image and text overlays
protected InitializeStandardOverlays ( ) : void
Результат void

InitializeStateImageList() защищенный Метод

Initialize the state image list with the required checkbox images
protected InitializeStateImageList ( ) : void
Результат void

InsertObjects() публичный Метод

Insert the given collection of objects before the given position

This operation only makes sense of non-sorted, non-grouped lists, since any subsequent sort/group operation will rearrange the list.

This method only works on ObjectListViews and FastObjectListViews.

public InsertObjects ( int index, ICollection modelObjects ) : void
index int Where to insert the objects
modelObjects ICollection The objects to be inserted
Результат void

IsChecked() публичный Метод

Return true of the given object is checked
If the given object is not in the list, this method returns false.
public IsChecked ( object modelObject ) : bool
modelObject object The model object whose checkedness is returned
Результат bool

IsCheckedIndeterminate() публичный Метод

Return true of the given object is indeterminately checked
If the given object is not in the list, this method returns false.
public IsCheckedIndeterminate ( object modelObject ) : bool
modelObject object The model object whose checkedness is returned
Результат bool

IsEnumerableEmpty() публичный статический Метод

public static IsEnumerableEmpty ( IEnumerable collection ) : bool
collection IEnumerable
Результат bool

IsSelected() публичный Метод

Return true if the row representing the given model is selected
public IsSelected ( object model ) : bool
model object The model object to look for
Результат bool

IsSubItemChecked() публичный Метод

Is there a check at the check box at the given cell
public IsSubItemChecked ( object rowObject, OLVColumn column ) : bool
rowObject object
column OLVColumn
Результат bool

IsUrlVisited() публичный Метод

Has the given URL been visited?
public IsUrlVisited ( string url ) : bool
url string The string to be consider
Результат bool

LowLevelHitTest() защищенный Метод

Perform a hit test using the Windows control's SUBITEMHITTEST message. This provides information about group hits that the standard ListView.HitTest() does not.
protected LowLevelHitTest ( int x, int y ) : OlvListViewHitTestInfo
x int
y int
Результат OlvListViewHitTestInfo

MakeColumnCommandMenu() публичный Метод

Append the column selection menu items to the given menu strip.
public MakeColumnCommandMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown
strip ToolStripDropDown The menu to which the items will be added.
columnIndex int
Результат ToolStripDropDown

MakeColumnSelectMenu() публичный Метод

Append the column selection menu items to the given menu strip.
public MakeColumnSelectMenu ( ToolStripDropDown strip ) : ToolStripDropDown
strip ToolStripDropDown The menu to which the items will be added.
Результат ToolStripDropDown

MakeDefaultCellEditor() защищенный Метод

Return a TextBox that can be used as a default cell editor.
protected MakeDefaultCellEditor ( OLVColumn column ) : Control
column OLVColumn What column does the cell belong to?
Результат Control

MakeFilteringMenu() публичный Метод

Create a Filtering menu
public MakeFilteringMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown
strip ToolStripDropDown
columnIndex int
Результат ToolStripDropDown

MakeGroups() защищенный Метод

Make a list of groups that should be shown according to the given parameters
This should not change the state of the control. It is possible that the groups created will not be used. They may simply be discarded.
protected MakeGroups ( GroupingParameters parms ) : IList
parms GroupingParameters
Результат IList

MakeHeaderRightClickMenu() защищенный Метод

Create the menu that should be displayed when the user right clicks on the given column header.
protected MakeHeaderRightClickMenu ( int columnIndex ) : ToolStripDropDown
columnIndex int Index of the column that was right clicked. /// This can be negative, which indicates a click outside of any header.
Результат ToolStripDropDown

MakeSortIndicatorImages() защищенный Метод

If the sort indicator images don't already exist, this method will make and install them
protected MakeSortIndicatorImages ( ) : void
Результат void

MarkUrlVisited() публичный Метод

Remember that the given URL has been visited
This does not cause the control be redrawn
public MarkUrlVisited ( string url ) : void
url string The url to be remembered
Результат void

ModelToItem() публичный Метод

Return the OLVListItem that displays the given model object
This method has O(n) performance.
public ModelToItem ( object modelObject ) : OLVListItem
modelObject object The modelObject whose item is to be found
Результат OLVListItem

MoveObjects() публичный Метод

Move the given collection of objects to the given index.
This operation only makes sense on non-grouped ObjectListViews.
public MoveObjects ( int index, ICollection modelObjects ) : void
index int
modelObjects ICollection
Результат void

ObjectListView() публичный Метод

Create an ObjectListView
public ObjectListView ( ) : System
Результат System

ObjectsToHtml() публичный Метод

Return a html representation of the given objects
public ObjectsToHtml ( IList objectsToConvert ) : string
objectsToConvert IList
Результат string

OlvHitTest() публичный Метод

What is under the given point? This takes the various parts of a cell into accout, including any custom parts that a custom renderer might use
public OlvHitTest ( int x, int y ) : OlvListViewHitTestInfo
x int
y int
Результат OlvListViewHitTestInfo

OnColumnReordered() защищенный Метод

Override the OnColumnReordered method to do what we want
protected OnColumnReordered ( ColumnReorderedEventArgs e ) : void
e ColumnReorderedEventArgs
Результат void

OnControlCreated() защищенный Метод

This method is called after the control has been fully created.
protected OnControlCreated ( ) : void
Результат void

OnDragDrop() защищенный Метод

protected OnDragDrop ( DragEventArgs args ) : void
args DragEventArgs
Результат void

OnDragEnter() защищенный Метод

protected OnDragEnter ( DragEventArgs args ) : void
args DragEventArgs
Результат void

OnDragLeave() защищенный Метод

protected OnDragLeave ( EventArgs e ) : void
e EventArgs
Результат void

OnDragOver() защищенный Метод

protected OnDragOver ( DragEventArgs args ) : void
args DragEventArgs
Результат void

OnDrawColumnHeader() защищенный Метод

Owner draw the column header
protected OnDrawColumnHeader ( DrawListViewColumnHeaderEventArgs e ) : void
e DrawListViewColumnHeaderEventArgs
Результат void

OnDrawItem() защищенный Метод

Owner draw the item
protected OnDrawItem ( DrawListViewItemEventArgs e ) : void
e DrawListViewItemEventArgs
Результат void

OnDrawSubItem() защищенный Метод

Owner draw a single subitem
protected OnDrawSubItem ( DrawListViewSubItemEventArgs e ) : void
e DrawListViewSubItemEventArgs
Результат void

OnGiveFeedback() защищенный Метод

protected OnGiveFeedback ( GiveFeedbackEventArgs args ) : void
args GiveFeedbackEventArgs
Результат void

OnHandleCreated() защищенный Метод

Called when the handle of the underlying control is created
protected OnHandleCreated ( EventArgs e ) : void
e EventArgs
Результат void

OnItemDrag() защищенный Метод

protected OnItemDrag ( ItemDragEventArgs e ) : void
e ItemDragEventArgs
Результат void

OnMouseDown() защищенный Метод

We need the click count in the mouse up event, but that is always 1. So we have to remember the click count from the preceding mouse down event.
protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnMouseLeave() защищенный Метод

When the mouse leaves the control, remove any hot item highlighting
protected OnMouseLeave ( EventArgs e ) : void
e EventArgs
Результат void

OnMouseMove() защищенный Метод

When the mouse moves, we might need to change the hot item.
protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnMouseUp() защищенный Метод

Check to see if we need to start editing a cell
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnQueryContinueDrag() защищенный Метод

protected OnQueryContinueDrag ( QueryContinueDragEventArgs args ) : void
args QueryContinueDragEventArgs
Результат void

OnRightMouseUp() защищенный Метод

The user right clicked on the control
protected OnRightMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Результат void

OnSelectedIndexChanged() защищенный Метод

This method is called every time a row is selected or deselected. This can be a pain if the user shift-clicks 100 rows. We override this method so we can trigger one event for any number of select/deselects that come from one user action
protected OnSelectedIndexChanged ( EventArgs e ) : void
e EventArgs
Результат void

PauseAnimations() публичный Метод

Pause (or unpause) all animations in the list
public PauseAnimations ( bool isPause ) : void
isPause bool true to pause, false to unpause
Результат void

PossibleFinishCellEditing() публичный Метод

If a cell edit is in progress, finish the edit.
This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.
public PossibleFinishCellEditing ( ) : bool
Результат bool

PossibleFinishCellEditing() публичный Метод

If a cell edit is in progress, finish the edit.
This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.
public PossibleFinishCellEditing ( bool expectingCellEdit ) : bool
expectingCellEdit bool True if it is likely that another cell is going to be /// edited immediately after this cell finishes editing
Результат bool

PostProcessOneRow() защищенный Метод

Do the work required after one item in a listview have been created
protected PostProcessOneRow ( int rowIndex, int displayIndex, OLVListItem olvi ) : void
rowIndex int
displayIndex int
olvi OLVListItem
Результат void

PostProcessRows() защищенный Метод

Do the work required after the items in a listview have been created
protected PostProcessRows ( ) : void
Результат void

ProcessDialogKey() защищенный Метод

Handle a key press on this control. We specifically look for F2 which edits the primary column, or a Tab character during an edit operation, which tries to start editing on the next (or previous) cell.
protected ProcessDialogKey ( Keys keyData ) : bool
keyData Keys
Результат bool

ProcessHyperlinkClicked() защищенный Метод

Tell the world that a hyperlink was clicked and if the event isn't handled, do the default processing.
protected ProcessHyperlinkClicked ( CellClickEventArgs e ) : void
e CellClickEventArgs
Результат void

ProcessLButtonDoubleClick() защищенный Метод

Handle a mouse double click at the given hit test location
Subclasses can override this to do something unique
protected ProcessLButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Результат bool

ProcessLButtonDown() защищенный Метод

Handle a left mouse down at the given hit test location
Subclasses can override this to do something unique
protected ProcessLButtonDown ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Результат bool

ProcessRButtonDoubleClick() защищенный Метод

Handle a right mouse double click at the given hit test location
Subclasses can override this to do something unique
protected ProcessRButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Результат bool

ProcessRButtonDown() защищенный Метод

Handle a left mouse down at the given hit test location
Subclasses can override this to do something unique
protected ProcessRButtonDown ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Результат bool

PutCheckState() защищенный Метод

Record the change of checkstate for the given object in the model. This does not update the UI -- only the model
protected PutCheckState ( Object modelObject, CheckState state ) : CheckState
modelObject Object
state CheckState
Результат CheckState

RebuildColumns() публичный Метод

Rebuild the columns based upon its current view and column visibility settings
public RebuildColumns ( ) : void
Результат void

RefreshHotItem() публичный Метод

Force the hot item to be recalculated
public RefreshHotItem ( ) : void
Результат void

RefreshItem() публичный Метод

Update the ListViewItem with the data from its associated model.
This method does not resort or regroup the view. It simply updates the displayed data of the given item
public RefreshItem ( OLVListItem olvi ) : void
olvi OLVListItem
Результат void

RefreshObject() публичный Метод

Update the rows that are showing the given objects
This method does not resort or regroup the view.
public RefreshObject ( object modelObject ) : void
modelObject object
Результат void

RefreshObjects() публичный Метод

Update the rows that are showing the given objects

This method does not resort or regroup the view.

This method can safely be called from background threads.

public RefreshObjects ( IList modelObjects ) : void
modelObjects IList
Результат void

RefreshOverlay() публичный Метод

Refresh the display of just one overlays
public RefreshOverlay ( IOverlay overlay ) : void
overlay IOverlay
Результат void

RefreshOverlays() публичный Метод

Refresh the display of the overlays
public RefreshOverlays ( ) : void
Результат void

RefreshSelectedObjects() публичный Метод

Update the rows that are selected
This method does not resort or regroup the view.
public RefreshSelectedObjects ( ) : void
Результат void

RemoveDecoration() публичный Метод

Remove the given decoration from this list
public RemoveDecoration ( IDecoration decoration ) : void
decoration IDecoration The decoration to remove
Результат void

RemoveObject() публичный Метод

Remove the given model object from the ListView
See RemoveObjects() for more details

This method is thread-safe.

public RemoveObject ( object modelObject ) : void
modelObject object The model to be removed
Результат void

RemoveObjects() публичный Метод

Remove all of the given objects from the control.

Nulls and model objects that are not in the ListView are silently ignored.

This method is thread-safe.

public RemoveObjects ( ICollection modelObjects ) : void
modelObjects ICollection Collection of objects to be removed
Результат void

RemoveOverlay() публичный Метод

Remove the given overlay to those on this list
public RemoveOverlay ( IOverlay overlay ) : void
overlay IOverlay The overlay
Результат void

Reset() публичный Метод

Make the list forget everything -- all rows and all columns
Use ClearObjects if you want to remove just the rows.
public Reset ( ) : void
Результат void

ResetColumnFiltering() публичный Метод

Remove all column filtering.
public ResetColumnFiltering ( ) : void
Результат void

ResizeFreeSpaceFillingColumns() защищенный Метод

Resize our space filling columns so they fill any unoccupied width in the control
protected ResizeFreeSpaceFillingColumns ( ) : void
Результат void

ResizeFreeSpaceFillingColumns() защищенный Метод

Resize our space filling columns so they fill any unoccupied width in the control
protected ResizeFreeSpaceFillingColumns ( int freeSpace ) : void
freeSpace int
Результат void

RestoreState() публичный Метод

Restore the state of the control from the given string, which must have been produced by SaveState()
public RestoreState ( byte state ) : bool
state byte A byte array returned from SaveState()
Результат bool

SaveState() публичный Метод

Return a byte array that represents the current state of the ObjectListView, such that the state can be restored by RestoreState()

The state of an ObjectListView includes the attributes that the user can modify: current view (i.e. Details, Tile, Large Icon...) sort column and direction column order column widths column visibility

It does not include selection or the scroll position.

public SaveState ( ) : byte[]
Результат byte[]

SelectAll() публичный Метод

Select all rows in the listview
public SelectAll ( ) : void
Результат void

SelectObject() публичный Метод

Select the row that is displaying the given model object, in addition to any current selection.
Use the SelectedObject property to deselect all other rows
public SelectObject ( object modelObject ) : void
modelObject object The object to be selected
Результат void

SelectObject() публичный Метод

Select the row that is displaying the given model object, in addition to any current selection.
Use the SelectedObject property to deselect all other rows
public SelectObject ( object modelObject, bool setFocus ) : void
modelObject object The object to be selected
setFocus bool Should the object be focused as well?
Результат void

SelectObjects() публичный Метод

Select the rows that is displaying any of the given model object. All other rows are deselected.
public SelectObjects ( IList modelObjects ) : void
modelObjects IList A collection of model objects
Результат void

SetControlValue() защищенный Метод

Try to give the given value to the provided control. Fall back to assigning a string if the value assignment fails.
protected SetControlValue ( Control control, Object value, String stringValue ) : void
control Control A control
value Object The value to be given to the control
stringValue String The string to be given if the value doesn't work
Результат void

SetNativeBackgroundImage() публичный Метод

Set the given image to be background of the ListView so that it appears at the given percentage offsets within the list.

This has the same limitations as described in SetNativeBackgroundWatermark. Make sure those limitations are understood before using the method.

This is very similar to setting the System.Windows.Forms.Control.BackgroundImage property of the standard .NET ListView, except that the standard BackgroundImage does not handle images with transparent areas properly -- it renders transparent areas as black. This method does not have that problem.

Setting this clears any background watermark.

public SetNativeBackgroundImage ( Image image, int xOffset, int yOffset ) : void
image Image The image to be drawn. If null, any existing image will be removed.
xOffset int The horizontal percentage where the image will be placed. 0 is absolute left, 100 is absolute right.
yOffset int The vertical percentage where the image will be placed.
Результат void

SetNativeBackgroundTiledImage() публичный Метод

Set the given image to be the tiled background of the ListView.

This has the same limitations as described in SetNativeBackgroundWatermark and SetNativeBackgroundImage. Make sure those limitations are understood before using the method.

public SetNativeBackgroundTiledImage ( Image image ) : void
image Image The image to be drawn. If null, any existing image will be removed.
Результат void

SetNativeBackgroundWatermark() публичный Метод

Set the given image to be fixed in the bottom right of the list view. This image will not scroll when the list view scrolls.

This method uses ListView's native ability to display a background image. It has a few limitations:

It doesn't work well with owner drawn mode. In owner drawn mode, each cell draws itself, including its background, which covers the background image. It doesn't look very good when grid lines are enabled, since the grid lines are drawn over the image. It does not work at all on XP. Obviously, it doesn't look good when alternate row background colors are enabled.

If you can live with these limitations, native watermarks are quite neat. They are true backgrounds, not translucent overlays like the OverlayImage uses. They also have the decided advantage over overlays in that they work correctly even in MDI applications.

Setting this clears any background image.

public SetNativeBackgroundWatermark ( Image image ) : void
image Image The image to be drawn. If null, any existing image will be removed.
Результат void

SetObjectCheckedness() защищенный Метод

Change the check state of the given object to be the given state.
If the given model object isn't in the list, we still try to remember its state, in case it is referenced in the future.
protected SetObjectCheckedness ( object modelObject, CheckState state ) : void
modelObject object
state CheckState
Результат void

SetObjects() публичный Метод

Set the collection of objects that will be shown in this list view.
The list is updated immediately
public SetObjects ( IEnumerable collection ) : void
collection IEnumerable The objects to be displayed
Результат void

SetObjects() публичный Метод

Set the collection of objects that will be shown in this list view.
The list is updated immediately
public SetObjects ( IEnumerable collection, bool preserveState ) : void
collection IEnumerable The objects to be displayed
preserveState bool Should the state of the list be preserved as far as is possible.
Результат void

SetPersistentCheckState() защищенный Метод

Remember the check state of the given model object
protected SetPersistentCheckState ( object model, CheckState state ) : CheckState
model object The model to be remembered
state CheckState The model's checkedness
Результат CheckState

SetSubItemImage() публичный Метод

Set the subitem image natively
public SetSubItemImage ( int rowIndex, int subItemIndex, OLVListSubItem subItem, bool shouldClearImages ) : void
rowIndex int
subItemIndex int
subItem OLVListSubItem
shouldClearImages bool
Результат void

SetSubItemImages() защищенный Метод

Tell the underlying list control which images to show against the subitems
protected SetSubItemImages ( int rowIndex, OLVListItem item ) : void
rowIndex int the index at which the item occurs
item OLVListItem the item whose subitems are to be set
Результат void

SetSubItemImages() защищенный Метод

Tell the underlying list control which images to show against the subitems
protected SetSubItemImages ( int rowIndex, OLVListItem item, bool shouldClearImages ) : void
rowIndex int the index at which the item occurs
item OLVListItem the item whose subitems are to be set
shouldClearImages bool will existing images be cleared if no new image is provided?
Результат void

SetupSubItemCheckBoxes() публичный Метод

Setup this control so it can display check boxes on subitems (or primary checkboxes in virtual mode)
This gives the ListView a small image list, if it doesn't already have one.
public SetupSubItemCheckBoxes ( ) : void
Результат void

ShouldStartCellEdit() защищенный Метод

Should we start editing the cell in response to the given mouse button event?
protected ShouldStartCellEdit ( MouseEventArgs e ) : bool
e MouseEventArgs
Результат bool

ShowHeaderRightClickMenu() защищенный Метод

Show a menu that is appropriate when the given column header is clicked.
protected ShowHeaderRightClickMenu ( int columnIndex, Point pt ) : bool
columnIndex int The index of the header that was clicked. This /// can be -1, indicating that the header was clicked outside of a column
pt Point Where should the menu be shown
Результат bool

ShowOverlays() публичный Метод

Make sure that any overlays are visible.
public ShowOverlays ( ) : void
Результат void

ShowSortIndicator() публичный Метод

Put a sort indicator next to the text of the sort column
public ShowSortIndicator ( ) : void
Результат void

ShowSortIndicator() защищенный Метод

Put a sort indicator next to the text of the given given column
protected ShowSortIndicator ( OLVColumn columnToSort, SortOrder sortOrder ) : void
columnToSort OLVColumn The column to be marked
sortOrder SortOrder The sort order in effect on that column
Результат void

Sort() публичный Метод

Sort the items by the last sort column and order
public Sort ( ) : void
Результат void

Sort() публичный Метод

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( OLVColumn columnToSort ) : void
columnToSort OLVColumn The column whose values will be used for the sorting
Результат void

Sort() публичный Метод

Sort the items in the list view by the values in the given column and by the given order.
If ShowGroups is true, the rows will be grouped by the given column. If AlwaysGroupsByColumn is not null, the rows will be grouped by that column, and the rows within each group will be sorted by the given column.
public Sort ( OLVColumn columnToSort, SortOrder order ) : void
columnToSort OLVColumn The column whose values will be used for the sorting. /// If null, the first column will be used.
order SortOrder The ordering to be used for sorting. If this is None, /// this.Sorting and then SortOrder.Ascending will be used
Результат void

Sort() публичный Метод

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( int columnToSortIndex ) : void
columnToSortIndex int The index of the column whose values will be used for the sorting
Результат void

Sort() публичный Метод

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( string columnToSortName ) : void
columnToSortName string The name of the column whose values will be used for the sorting
Результат void

StandardHyperlinkClickedProcessing() защищенный Метод

Do the default processing for a hyperlink clicked event, which is to try and open the url.
protected StandardHyperlinkClickedProcessing ( HyperlinkClickedEventArgs args ) : void
args HyperlinkClickedEventArgs
Результат void

StartCellEdit() публичный Метод

Really start an edit operation on a given cell. The parameters are assumed to be sane.
public StartCellEdit ( OLVListItem item, int subItemIndex ) : void
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Результат void

TakeOwnershipOfObjects() защищенный Метод

Take ownership of the 'objects' collection. This separats our collection from the source.

This method separates the 'objects' instance variable from its source, so that any AddObject/RemoveObject calls will modify our collection and not the original colleciton.

This method has the intentional side-effect of converting our list of objects to an ArrayList.

protected TakeOwnershipOfObjects ( ) : void
Результат void

ToggleCheckObject() публичный Метод

Toggle the checkedness of the given object. A checked object becomes unchecked; an unchecked or indeterminate object becomes checked. If the list has tristate checkboxes, the order is: unchecked -> checked -> indeterminate -> unchecked ...
public ToggleCheckObject ( object modelObject ) : void
modelObject object The model object to be checked
Результат void

ToggleSubItemCheckBox() публичный Метод

Toggle the check at the check box of the given cell
public ToggleSubItemCheckBox ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Результат void

TriggerFormatRowEvent() защищенный Метод

Trigger FormatRow and possibly FormatCell events for the given item
protected TriggerFormatRowEvent ( int rowIndex, int displayIndex, OLVListItem olvi ) : void
rowIndex int
displayIndex int
olvi OLVListItem
Результат void

TriggerGroupExpandCollapse() защищенный Метод

Trigger a GroupExpandCollapse event and return true if the action was cancelled
protected TriggerGroupExpandCollapse ( OLVGroup group ) : bool
group OLVGroup
Результат bool

UnapplyHotItem() защищенный Метод

Remove hot item styling from the given row
protected UnapplyHotItem ( int index ) : void
index int
Результат void

UncheckObject() публичный Метод

Mark the given object as unchecked in the list
public UncheckObject ( object modelObject ) : void
modelObject object The model object to be unchecked
Результат void

UncheckObjects() публичный Метод

Mark the given objects as unchecked in the list
public UncheckObjects ( IEnumerable modelObjects ) : void
modelObjects IEnumerable The model object to be checked
Результат void

UncheckSubItem() публичный Метод

Uncheck the check at the given cell
public UncheckSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Результат void

Unfreeze() публичный Метод

Unfreeze the listview. If this call is the outermost Unfreeze(), the contents of the listview will be rebuilt.
Freeze()/Unfreeze() calls nest correctly
public Unfreeze ( ) : void
Результат void

Unsort() публичный Метод

Remove any sorting and revert to the given order of the model objects
public Unsort ( ) : void
Результат void

UpdateCellToolTipHandle() защищенный Метод

Update the handle used by our cell tooltip to be the tooltip used by the underlying Windows listview control.
protected UpdateCellToolTipHandle ( ) : void
Результат void

UpdateColumnFiltering() публичный Метод

Update the filtering of this ObjectListView based on the value filtering defined in each column
public UpdateColumnFiltering ( ) : void
Результат void

UpdateFiltering() защищенный Метод

When some setting related to filtering changes, this method is called.
protected UpdateFiltering ( ) : void
Результат void

UpdateHotItem() защищенный Метод

The mouse has moved to the given pt. See if the hot item needs to be updated
This is the main entry point for hot item handling
protected UpdateHotItem ( OlvListViewHitTestInfo hti ) : void
hti OlvListViewHitTestInfo
Результат void

UpdateHotItem() защищенный Метод

The mouse has moved to the given pt. See if the hot item needs to be updated
This is the main entry point for hot item handling
protected UpdateHotItem ( Point pt ) : void
pt Point Where is the mouse?
Результат void

UpdateHotRow() защищенный Метод

Update the given row using the current hot item information
protected UpdateHotRow ( OLVListItem olvi ) : void
olvi OLVListItem
Результат void

UpdateHotRow() защищенный Метод

Update the given row using the given hot item information
protected UpdateHotRow ( int rowIndex, int columnIndex, HitTestLocation hitLocation, OLVListItem olvi ) : void
rowIndex int
columnIndex int
hitLocation HitTestLocation
olvi OLVListItem
Результат void

UpdateNotificationSubscriptions() защищенный Метод

Change any subscriptions to INotifyPropertyChanged events on our current model objects so that we no longer listen for events on the old models and do listen for events on the given collection.
This does nothing if UseNotifyPropertyChanged is false.
protected UpdateNotificationSubscriptions ( IEnumerable collection ) : void
collection IEnumerable
Результат void

WndProc() защищенный Метод

Override the basic message pump for this control
protected WndProc ( Message &m ) : void
m Message
Результат void

Описание свойств

EditorRegistry публичное статическое свойство

This registry decides what control should be used to edit what cells, based on the type of the value in the cell.
All instances of ObjectListView share the same editor registry.
public static EditorRegistry EditorRegistry
Результат EditorRegistry

SortAscendingImage публичное статическое свойство

Gets or sets the image that will be place next to the Sort Ascending command
public static Bitmap SortAscendingImage
Результат Bitmap

SortDescendingImage публичное статическое свойство

Gets or sets the image that will be placed next to the Sort Descending command
public static Bitmap SortDescendingImage
Результат Bitmap