C# Class Smrf.AppLib.ListViewPlus

Represents a ListView with additional features.
This ListView-derived object supports sorting by a column that contains data of an arbitrary type. To enable sorting, populate the ListView.Columns collection, then call the EnableSorting method. You can then call the Sort method to sort by a specified column. Sorting also occurs automatically when the user clicks a column header.

By default, right-clicking an item in the ListView shows a context menu with a set of standard menu items supported by this base class. If the derived class needs a custom context menu, it should set UseStandardContextMenu to false and override OnMouseUp(). The derived OnMouseUp() should create and show a custom context menu, then call the base-class method. If the custom context menu should contain the standard menu items in addition to the custom items, should be called to add those items to the menu.

Leave the ListView.Sorting property set to its default value of SortOrder.None.

Inheritance: System.Windows.Forms.ListView, IComparer
Afficher le fichier Open project: 2014-sed-team3/term-project

Méthodes publiques

Свойство Type Description
NoColumn System.Int32

Protected Properties

Свойство Type Description
m_aeColumnTypes ColumnType[]
m_bSortAscending System.Boolean
m_bUseStandardContextMenu System.Boolean
m_iColumnToCopy System.Int32
m_iSortColumn System.Int32
m_oRightClickedItem System.Windows.Forms.ListViewItem

Private Properties

Свойство Type Description
AssertValid void

Méthodes publiques

Méthode Description
AddStandardContextMenuItems ( ContextMenu oContextMenu, System.Boolean bAddSeparator ) : void
BeginUpdate ( ) : void
Compare ( Object oObject1, Object oObject2 ) : Int32
DeselectAllItems ( ) : void
EnableSorting ( ) : void
EndUpdate ( ) : void
GetItemByTag ( Int32 iTag ) : System.Windows.Forms.ListViewItem
GetItemByTag ( Object oTag ) : System.Windows.Forms.ListViewItem
GetRightClickedItem ( MouseEventArgs oMouseEventArgs ) : System.Windows.Forms.ListViewItem
ListViewPlus ( ) : System

Initializes a new instance of the ListViewPlus class.

Sort ( Int32 iColumn, System.Boolean bSortAscending ) : void

Méthodes protégées

Méthode Description
ColumnToColumnType ( Int32 iColumn ) : ColumnType
CopyAll_Click ( object sender, System e ) : void
CopyColumn_Click ( object sender, System e ) : void
CopyRow_Click ( object sender, System e ) : void
ItemToClipboardString ( System.Windows.Forms.ListViewItem oListViewItem ) : String
ItemToClipboardString ( System.Windows.Forms.ListViewItem oListViewItem, StringBuilder oStringBuilder ) : void
OnColumnClick ( object sender, System.Windows.Forms.ColumnClickEventArgs e ) : void
OnMouseUp ( MouseEventArgs e ) : void
TypeToColumnType ( Type oType ) : ColumnType

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

AddStandardContextMenuItems() public méthode

public AddStandardContextMenuItems ( ContextMenu oContextMenu, System.Boolean bAddSeparator ) : void
oContextMenu System.Windows.Forms.ContextMenu
bAddSeparator System.Boolean
Résultat void

BeginUpdate() public méthode

public BeginUpdate ( ) : void
Résultat void

ColumnToColumnType() protected méthode

protected ColumnToColumnType ( Int32 iColumn ) : ColumnType
iColumn System.Int32
Résultat ColumnType

Compare() public méthode

public Compare ( Object oObject1, Object oObject2 ) : Int32
oObject1 Object
oObject2 Object
Résultat System.Int32

CopyAll_Click() protected méthode

protected CopyAll_Click ( object sender, System e ) : void
sender object
e System
Résultat void

CopyColumn_Click() protected méthode

protected CopyColumn_Click ( object sender, System e ) : void
sender object
e System
Résultat void

CopyRow_Click() protected méthode

protected CopyRow_Click ( object sender, System e ) : void
sender object
e System
Résultat void

DeselectAllItems() public méthode

public DeselectAllItems ( ) : void
Résultat void

EnableSorting() public méthode

public EnableSorting ( ) : void
Résultat void

EndUpdate() public méthode

public EndUpdate ( ) : void
Résultat void

GetItemByTag() public méthode

public GetItemByTag ( Int32 iTag ) : System.Windows.Forms.ListViewItem
iTag System.Int32
Résultat System.Windows.Forms.ListViewItem

GetItemByTag() public méthode

public GetItemByTag ( Object oTag ) : System.Windows.Forms.ListViewItem
oTag Object
Résultat System.Windows.Forms.ListViewItem

GetRightClickedItem() public méthode

public GetRightClickedItem ( MouseEventArgs oMouseEventArgs ) : System.Windows.Forms.ListViewItem
oMouseEventArgs System.Windows.Forms.MouseEventArgs
Résultat System.Windows.Forms.ListViewItem

ItemToClipboardString() protected méthode

protected ItemToClipboardString ( System.Windows.Forms.ListViewItem oListViewItem ) : String
oListViewItem System.Windows.Forms.ListViewItem
Résultat String

ItemToClipboardString() protected méthode

protected ItemToClipboardString ( System.Windows.Forms.ListViewItem oListViewItem, StringBuilder oStringBuilder ) : void
oListViewItem System.Windows.Forms.ListViewItem
oStringBuilder StringBuilder
Résultat void

ListViewPlus() public méthode

Initializes a new instance of the ListViewPlus class.
public ListViewPlus ( ) : System
Résultat System

OnColumnClick() protected méthode

protected OnColumnClick ( object sender, System.Windows.Forms.ColumnClickEventArgs e ) : void
sender object
e System.Windows.Forms.ColumnClickEventArgs
Résultat void

OnMouseUp() protected méthode

protected OnMouseUp ( MouseEventArgs e ) : void
e System.Windows.Forms.MouseEventArgs
Résultat void

Sort() public méthode

public Sort ( Int32 iColumn, System.Boolean bSortAscending ) : void
iColumn System.Int32
bSortAscending System.Boolean
Résultat void

TypeToColumnType() protected méthode

protected TypeToColumnType ( Type oType ) : ColumnType
oType System.Type
Résultat ColumnType

Property Details

NoColumn public_oe static_oe property

public static Int32,System NoColumn
Résultat System.Int32

m_aeColumnTypes protected_oe property

protected ColumnType[] m_aeColumnTypes
Résultat ColumnType[]

m_bSortAscending protected_oe property

protected Boolean,System m_bSortAscending
Résultat System.Boolean

m_bUseStandardContextMenu protected_oe property

protected Boolean,System m_bUseStandardContextMenu
Résultat System.Boolean

m_iColumnToCopy protected_oe property

protected Int32,System m_iColumnToCopy
Résultat System.Int32

m_iSortColumn protected_oe property

protected Int32,System m_iSortColumn
Résultat System.Int32

m_oRightClickedItem protected_oe property

protected ListViewItem,System.Windows.Forms m_oRightClickedItem
Résultat System.Windows.Forms.ListViewItem