C# Класс BrightIdeasSoftware.FilterMenuBuilder

Instances of this class know how to build a Filter menu. It is responsible for clustering the values in the target column, build a menu that shows those clusters, and then constructing a filter that will enact the users choices.
Almost all of the methods in this class are declared as "virtual protected" so that subclasses can provide alternative behaviours.
Показать файл Открыть проект

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

Свойство Тип Описание
APPLY_LABEL string
CLEAR_ALL_FILTERS_LABEL string
ClearFilteringImage System.Drawing.Bitmap
FILTERING_LABEL string
FilteringImage System.Drawing.Bitmap
SELECT_ALL_LABEL string

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

Метод Описание
MakeFilterMenu ( ToolStripDropDown strip, ObjectListView listView, OLVColumn column ) : ToolStripDropDown

Create a Filter menu on the given tool tip for the given column in the given ObjectListView.

This is the main entry point into this class.

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

Метод Описание
ClearAllFilters ( OLVColumn column ) : void

Clear all the filters that are applied to the given column

Cluster ( IClusteringStrategy strategy, ObjectListView listView, OLVColumn column ) : List

Create a collection of clusters that should be presented to the user

CreateFilteringMenuItem ( OLVColumn column, List clusters ) : ToolStripMenuItem

Do the work of making a menu that shows the clusters to the users

EnactFilter ( BrightIdeasSoftware.ToolStripCheckedListBox checkedList, OLVColumn column ) : void

Apply the selected values from the given list as a filter on the given column

HandleItemChecked ( object sender, System.Windows.Forms.ItemCheckEventArgs e ) : void

Handle a user-generated ItemCheck event

HandleSelectAllItem ( System.Windows.Forms.ItemCheckEventArgs e, BrightIdeasSoftware.ToolStripCheckedListBox checkedList, int selectAllIndex ) : void

Handle any checking/unchecking of the Select All option, and keep its checkedness in sync with everything else that is checked.

SortClusters ( IClusteringStrategy strategy, List clusters ) : void

Order the given list of clusters in the manner in which they should be presented to the user.

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

Метод Описание
ClusterOneModel ( IClusteringStrategy strategy, ICluster>.NullableDictionary map, object model ) : void
HandleItemCheckedWrapped ( object sender, System.Windows.Forms.ItemCheckEventArgs e ) : void

Wrap a protected section around the real HandleItemChecked method, so that if that method tries to change a "checkedness" of an item, we don't get a recursive stack error. Effectively, this ensure that HandleItemChecked is only called in response to a user action.

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

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

Clear all the filters that are applied to the given column
protected ClearAllFilters ( OLVColumn column ) : void
column OLVColumn The column from which filters are to be removed
Результат void

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

Create a collection of clusters that should be presented to the user
protected Cluster ( IClusteringStrategy strategy, ObjectListView listView, OLVColumn column ) : List
strategy IClusteringStrategy
listView ObjectListView
column OLVColumn
Результат List

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

Do the work of making a menu that shows the clusters to the users
protected CreateFilteringMenuItem ( OLVColumn column, List clusters ) : ToolStripMenuItem
column OLVColumn
clusters List
Результат System.Windows.Forms.ToolStripMenuItem

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

Apply the selected values from the given list as a filter on the given column
protected EnactFilter ( BrightIdeasSoftware.ToolStripCheckedListBox checkedList, OLVColumn column ) : void
checkedList BrightIdeasSoftware.ToolStripCheckedListBox A list in which the checked items should be used as filters
column OLVColumn The column for which a filter should be generated
Результат void

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

Handle a user-generated ItemCheck event
protected HandleItemChecked ( object sender, System.Windows.Forms.ItemCheckEventArgs e ) : void
sender object
e System.Windows.Forms.ItemCheckEventArgs
Результат void

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

Handle any checking/unchecking of the Select All option, and keep its checkedness in sync with everything else that is checked.
protected HandleSelectAllItem ( System.Windows.Forms.ItemCheckEventArgs e, BrightIdeasSoftware.ToolStripCheckedListBox checkedList, int selectAllIndex ) : void
e System.Windows.Forms.ItemCheckEventArgs
checkedList BrightIdeasSoftware.ToolStripCheckedListBox
selectAllIndex int
Результат void

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

Create a Filter menu on the given tool tip for the given column in the given ObjectListView.
This is the main entry point into this class.
public MakeFilterMenu ( ToolStripDropDown strip, ObjectListView listView, OLVColumn column ) : ToolStripDropDown
strip System.Windows.Forms.ToolStripDropDown
listView ObjectListView
column OLVColumn
Результат System.Windows.Forms.ToolStripDropDown

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

Order the given list of clusters in the manner in which they should be presented to the user.
protected SortClusters ( IClusteringStrategy strategy, List clusters ) : void
strategy IClusteringStrategy
clusters List
Результат void

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

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

Gets or sets the string that labels the Apply button. Exposed so it can be localized.
public static string APPLY_LABEL
Результат string

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

Gets or sets the string that labels the Clear All menu item. Exposed so it can be localized.
public static string CLEAR_ALL_FILTERS_LABEL
Результат string

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

Gets or sets the image that will be placed next to the Clear Filtering menu item
public static Bitmap,System.Drawing ClearFilteringImage
Результат System.Drawing.Bitmap

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

Gets or sets the string that labels the Filtering menu as a whole.. Exposed so it can be localized.
public static string FILTERING_LABEL
Результат string

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

Gets or sets the image that will be placed next to all "Apply" menu items on the filtering menu
public static Bitmap,System.Drawing FilteringImage
Результат System.Drawing.Bitmap

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

Gets or sets the string that represents Select All values. If this is set to null or empty, no Select All option will be included. Exposed so it can be localized.
public static string SELECT_ALL_LABEL
Результат string