ListViewGroupCollection Класс
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Представляет коллекцию групп в элементе ListView управления.
public ref class ListViewGroupCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class ListViewGroupCollection : System.Collections.IList
[<System.ComponentModel.ListBindable(false)>]
type ListViewGroupCollection = class
interface IList
interface ICollection
interface IEnumerable
Public Class ListViewGroupCollection
Implements IList
- Наследование
-
ListViewGroupCollection
- Атрибуты
- Реализации
Примеры
В следующем примере показано, как использовать ListView функцию группировки для упорядочивания элементов по значению в представлении сведений. Такая форма группировки аналогична группировке, используемой в проводнике Windows. В примере группы создаются динамически. Для каждого столбца подсети создается одна группа для каждого уникального значения подitem. Для столбца родительского элемента создается одна группа для каждой уникальной исходной буквы. Щелкнув заголовок столбца, сортирует элементы в группы, созданные для этого столбца. Щелкнув один и тот же заголовок столбца, снова изменит порядок групп.
#using <mscorlib.dll>
#using <System.Drawing.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Collections;
using namespace System::Windows::Forms;
public ref class ListViewGroupsExample : public Form
{
private:
ListView^ myListView;
bool isRunningXPOrLater;
// Declare a Hashtable array in which to store the groups.
array<Hashtable^>^ groupTables;
// Declare a variable to store the current grouping column.
int groupColumn;
public:
ListViewGroupsExample()
{
groupColumn = 0;
// Initialize myListView.
myListView = gcnew ListView();
myListView->Dock = DockStyle::Fill;
myListView->View = View::Details;
myListView->Sorting = SortOrder::Ascending;
// Create and initialize column headers for myListView.
ColumnHeader^ columnHeader0 = gcnew ColumnHeader();
columnHeader0->Text = "Title";
columnHeader0->Width = -1;
ColumnHeader^ columnHeader1 = gcnew ColumnHeader();
columnHeader1->Text = "Author";
columnHeader1->Width = -1;
ColumnHeader^ columnHeader2 = gcnew ColumnHeader();
columnHeader2->Text = "Year";
columnHeader2->Width = -1;
// Add the column headers to myListView.
array<ColumnHeader^>^ temp0 = {columnHeader0, columnHeader1, columnHeader2};
myListView->Columns->AddRange(temp0);
// Add a handler for the ColumnClick event.
myListView->ColumnClick +=
gcnew ColumnClickEventHandler(this, &ListViewGroupsExample::myListView_ColumnClick);
// Create items and add them to myListView.
array<String^>^ temp1 = {"Programming Windows", "Petzold, Charles", "1998"};
ListViewItem^ item0 = gcnew ListViewItem( temp1 );
array<String^>^ temp2 = {"Code: The Hidden Language of Computer Hardware and Software",
"Petzold, Charles", "2000"};
ListViewItem^ item1 = gcnew ListViewItem( temp2 );
array<String^>^ temp3 = {"Programming Windows with C#", "Petzold, Charles", "2001"};
ListViewItem^ item2 = gcnew ListViewItem( temp3 );
array<String^>^ temp4 = {"Coding Techniques for Microsoft Visual Basic .NET",
"Connell, John", "2001"};
ListViewItem^ item3 = gcnew ListViewItem( temp4 );
array<String^>^ temp5 = {"C# for Java Developers", "Jones, Allen & Freeman, Adam",
"2002"};
ListViewItem^ item4 = gcnew ListViewItem( temp5 );
array<String^>^ temp6 = {"Microsoft .NET XML Web Services Step by Step",
"Jones, Allen & Freeman, Adam", "2002"};
ListViewItem^ item5 = gcnew ListViewItem( temp6 );
array<ListViewItem^>^ temp7 = {item0, item1, item2, item3, item4, item5};
myListView->Items->AddRange( temp7 );
// Determine whether Windows XP or a later
// operating system is present.
isRunningXPOrLater = false;
if (System::Environment::OSVersion->Version->Major > 5 ||
( System::Environment::OSVersion->Version->Major == 5 &&
System::Environment::OSVersion->Version->Minor >= 1) )
{
isRunningXPOrLater = true;
}
if (isRunningXPOrLater)
{
// Create the groupsTable array and populate it with one
// hash table for each column.
groupTables = gcnew array<Hashtable^>(myListView->Columns->Count);
for (int column = 0; column < myListView->Columns->Count; column++)
{
// Create a hash table containing all the groups
// needed for a single column.
groupTables[column] = CreateGroupsTable(column);
}
// Start with the groups created for the Title column.
SetGroups(0);
}
// Initialize the form.
this->Controls->Add(myListView);
this->Size = System::Drawing::Size(550, 330);
this->Text = "ListView Groups Example";
}
// Groups the items using the groups created for the clicked
// column.
private:
void myListView_ColumnClick(
Object^ /*sender*/, ColumnClickEventArgs^ e)
{
// Set the sort order to ascending when changing
// column groups; otherwise, reverse the sort order.
if ( myListView->Sorting == SortOrder::Descending ||
( isRunningXPOrLater && (e->Column != groupColumn) ) )
{
myListView->Sorting = SortOrder::Ascending;
}
else
{
myListView->Sorting = SortOrder::Descending;
}
groupColumn = e->Column;
// Set the groups to those created for the clicked column.
if (isRunningXPOrLater)
{
SetGroups(e->Column);
}
}
// Sets myListView to the groups created for the specified column.
private:
void SetGroups(int column)
{
// Remove the current groups.
myListView->Groups->Clear();
// Retrieve the hash table corresponding to the column.
Hashtable^ groups = dynamic_cast<Hashtable^>(groupTables[column]);
// Copy the groups for the column to an array.
array<ListViewGroup^>^ groupsArray = gcnew array<ListViewGroup^>(groups->Count);
groups->Values->CopyTo(groupsArray, 0);
// Sort the groups and add them to myListView.
Array::Sort(groupsArray, gcnew ListViewGroupSorter(myListView->Sorting));
myListView->Groups->AddRange(groupsArray);
// Iterate through the items in myListView, assigning each
// one to the appropriate group.
IEnumerator^ myEnum = myListView->Items->GetEnumerator();
while (myEnum->MoveNext())
{
ListViewItem^ item = safe_cast<ListViewItem^>(myEnum->Current);
// Retrieve the subitem text corresponding to the column.
String^ subItemText = item->SubItems[column]->Text;
// For the Title column, use only the first letter.
if (column == 0)
{
subItemText = subItemText->Substring(0, 1);
}
// Assign the item to the matching group.
item->Group = dynamic_cast<ListViewGroup^>(groups[subItemText]);
}
}
// Creates a Hashtable object with one entry for each unique
// subitem value (or initial letter for the parent item)
// in the specified column.
private:
Hashtable^ CreateGroupsTable(int column)
{
// Create a Hashtable object.
Hashtable^ groups = gcnew Hashtable();
// Iterate through the items in myListView.
IEnumerator^ myEnum1 = myListView->Items->GetEnumerator();
while (myEnum1->MoveNext())
{
ListViewItem^ item = safe_cast<ListViewItem^>(myEnum1->Current);
// Retrieve the text value for the column.
String^ subItemText = item->SubItems[column]->Text;
// Use the initial letter instead if it is the first column.
if (column == 0)
{
subItemText = subItemText->Substring(0, 1);
}
// If the groups table does not already contain a group
// for the subItemText value, add a new group using the
// subItemText value for the group header and Hashtable key.
if (!groups->Contains(subItemText))
{
groups->Add( subItemText, gcnew ListViewGroup(subItemText,
HorizontalAlignment::Left) );
}
}
// Return the Hashtable object.
return groups;
}
// Sorts ListViewGroup objects by header value.
ref class ListViewGroupSorter : public IComparer
{
private:
SortOrder order;
// Stores the sort order.
public:
ListViewGroupSorter(SortOrder theOrder)
{
order = theOrder;
}
// Compares the groups by header value, using the saved sort
// order to return the correct value.
virtual int Compare(Object^ x, Object^ y)
{
int result = String::Compare(
(dynamic_cast<ListViewGroup^>(x))->Header,
(dynamic_cast<ListViewGroup^>(y))->Header
);
if (order == SortOrder::Ascending)
{
return result;
}
else
{
return -result;
}
}
};
};
[STAThread]
int main()
{
Application::EnableVisualStyles();
Application::Run(gcnew ListViewGroupsExample());
}
using System;
using System.Collections;
using System.Windows.Forms;
public class ListViewGroupsExample : Form
{
private ListView myListView;
// Determine whether Windows XP or a later
// operating system is present.
private bool isRunningXPOrLater =
OSFeature.Feature.IsPresent(OSFeature.Themes);
// Declare a Hashtable array in which to store the groups.
private Hashtable[] groupTables;
// Declare a variable to store the current grouping column.
int groupColumn = 0;
public ListViewGroupsExample()
{
// Initialize myListView.
myListView = new ListView();
myListView.Dock = DockStyle.Fill;
myListView.View = View.Details;
myListView.Sorting = SortOrder.Ascending;
// Create and initialize column headers for myListView.
ColumnHeader columnHeader0 = new ColumnHeader();
columnHeader0.Text = "Title";
columnHeader0.Width = -1;
ColumnHeader columnHeader1 = new ColumnHeader();
columnHeader1.Text = "Author";
columnHeader1.Width = -1;
ColumnHeader columnHeader2 = new ColumnHeader();
columnHeader2.Text = "Year";
columnHeader2.Width = -1;
// Add the column headers to myListView.
myListView.Columns.AddRange(new ColumnHeader[]
{columnHeader0, columnHeader1, columnHeader2});
// Add a handler for the ColumnClick event.
myListView.ColumnClick +=
new ColumnClickEventHandler(myListView_ColumnClick);
// Create items and add them to myListView.
ListViewItem item0 = new ListViewItem( new string[]
{"Programming Windows",
"Petzold, Charles",
"1998"} );
ListViewItem item1 = new ListViewItem( new string[]
{"Code: The Hidden Language of Computer Hardware and Software",
"Petzold, Charles",
"2000"} );
ListViewItem item2 = new ListViewItem( new string[]
{"Programming Windows with C#",
"Petzold, Charles",
"2001"} );
ListViewItem item3 = new ListViewItem( new string[]
{"Coding Techniques for Microsoft Visual Basic .NET",
"Connell, John",
"2001"} );
ListViewItem item4 = new ListViewItem( new string[]
{"C# for Java Developers",
"Jones, Allen & Freeman, Adam",
"2002"} );
ListViewItem item5 = new ListViewItem( new string[]
{"Microsoft .NET XML Web Services Step by Step",
"Jones, Allen & Freeman, Adam",
"2002"} );
myListView.Items.AddRange(
new ListViewItem[] {item0, item1, item2, item3, item4, item5});
if (isRunningXPOrLater)
{
// Create the groupsTable array and populate it with one
// hash table for each column.
groupTables = new Hashtable[myListView.Columns.Count];
for (int column = 0; column < myListView.Columns.Count; column++)
{
// Create a hash table containing all the groups
// needed for a single column.
groupTables[column] = CreateGroupsTable(column);
}
// Start with the groups created for the Title column.
SetGroups(0);
}
// Initialize the form.
this.Controls.Add(myListView);
this.Size = new System.Drawing.Size(550, 330);
this.Text = "ListView Groups Example";
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new ListViewGroupsExample());
}
// Groups the items using the groups created for the clicked
// column.
private void myListView_ColumnClick(
object sender, ColumnClickEventArgs e)
{
// Set the sort order to ascending when changing
// column groups; otherwise, reverse the sort order.
if ( myListView.Sorting == SortOrder.Descending ||
( isRunningXPOrLater && (e.Column != groupColumn) ) )
{
myListView.Sorting = SortOrder.Ascending;
}
else
{
myListView.Sorting = SortOrder.Descending;
}
groupColumn = e.Column;
// Set the groups to those created for the clicked column.
if (isRunningXPOrLater)
{
SetGroups(e.Column);
}
}
// Sets myListView to the groups created for the specified column.
private void SetGroups(int column)
{
// Remove the current groups.
myListView.Groups.Clear();
// Retrieve the hash table corresponding to the column.
Hashtable groups = (Hashtable)groupTables[column];
// Copy the groups for the column to an array.
ListViewGroup[] groupsArray = new ListViewGroup[groups.Count];
groups.Values.CopyTo(groupsArray, 0);
// Sort the groups and add them to myListView.
Array.Sort(groupsArray, new ListViewGroupSorter(myListView.Sorting));
myListView.Groups.AddRange(groupsArray);
// Iterate through the items in myListView, assigning each
// one to the appropriate group.
foreach (ListViewItem item in myListView.Items)
{
// Retrieve the subitem text corresponding to the column.
string subItemText = item.SubItems[column].Text;
// For the Title column, use only the first letter.
if (column == 0)
{
subItemText = subItemText.Substring(0, 1);
}
// Assign the item to the matching group.
item.Group = (ListViewGroup)groups[subItemText];
}
}
// Creates a Hashtable object with one entry for each unique
// subitem value (or initial letter for the parent item)
// in the specified column.
private Hashtable CreateGroupsTable(int column)
{
// Create a Hashtable object.
Hashtable groups = new Hashtable();
// Iterate through the items in myListView.
foreach (ListViewItem item in myListView.Items)
{
// Retrieve the text value for the column.
string subItemText = item.SubItems[column].Text;
// Use the initial letter instead if it is the first column.
if (column == 0)
{
subItemText = subItemText.Substring(0, 1);
}
// If the groups table does not already contain a group
// for the subItemText value, add a new group using the
// subItemText value for the group header and Hashtable key.
if (!groups.Contains(subItemText))
{
groups.Add( subItemText, new ListViewGroup(subItemText,
HorizontalAlignment.Left) );
}
}
// Return the Hashtable object.
return groups;
}
// Sorts ListViewGroup objects by header value.
private class ListViewGroupSorter : IComparer
{
private SortOrder order;
// Stores the sort order.
public ListViewGroupSorter(SortOrder theOrder)
{
order = theOrder;
}
// Compares the groups by header value, using the saved sort
// order to return the correct value.
public int Compare(object x, object y)
{
int result = String.Compare(
((ListViewGroup)x).Header,
((ListViewGroup)y).Header
);
if (order == SortOrder.Ascending)
{
return result;
}
else
{
return -result;
}
}
}
}
Imports System.Collections
Imports System.Windows.Forms
Public Class ListViewGroupsExample
Inherits Form
Private myListView As ListView
' Determine whether Windows XP or a later
' operating system is present.
Private isRunningXPOrLater As Boolean = _
OSFeature.Feature.IsPresent(OSFeature.Themes)
' Declare a Hashtable array in which to store the groups.
Private groupTables() As Hashtable
' Declare a variable to store the current grouping column.
Private groupColumn As Integer = 0
Public Sub New()
' Initialize myListView.
myListView = New ListView()
myListView.Dock = DockStyle.Fill
myListView.View = View.Details
myListView.Sorting = SortOrder.Ascending
' Create and initialize column headers for myListView.
Dim columnHeader0 As New ColumnHeader()
columnHeader0.Text = "Title"
columnHeader0.Width = -1
Dim columnHeader1 As New ColumnHeader()
columnHeader1.Text = "Author"
columnHeader1.Width = -1
Dim columnHeader2 As New ColumnHeader()
columnHeader2.Text = "Year"
columnHeader2.Width = -1
' Add the column headers to myListView.
myListView.Columns.AddRange( New ColumnHeader() _
{columnHeader0, columnHeader1, columnHeader2} )
' Add a handler for the ColumnClick event.
AddHandler myListView.ColumnClick, AddressOf myListView_ColumnClick
' Create items and add them to myListView.
Dim item0 As New ListViewItem( New String() _
{"Programming Windows", _
"Petzold, Charles", _
"1998"} )
Dim item1 As New ListViewItem( New String() _
{"Code: The Hidden Language of Computer Hardware and Software", _
"Petzold, Charles", _
"2000"} )
Dim item2 As New ListViewItem( New String() _
{"Programming Windows with C#", _
"Petzold, Charles", _
"2001"} )
Dim item3 As New ListViewItem( New String() _
{"Coding Techniques for Microsoft Visual Basic .NET", _
"Connell, John", _
"2001"} )
Dim item4 As New ListViewItem( New String() _
{"C# for Java Developers", _
"Jones, Allen / Freeman, Adam", _
"2002"} )
Dim item5 As New ListViewItem( New String() _
{"Microsoft .NET XML Web Services Step by Step", _
"Jones, Allen / Freeman, Adam", _
"2002"} )
myListView.Items.AddRange( _
New ListViewItem() {item0, item1, item2, item3, item4, item5})
If isRunningXPOrLater
' Create the groupsTable array and populate it with one
' hash table for each column.
groupTables = New Hashtable(myListView.Columns.Count) {}
Dim column As Integer
For column = 0 To myListView.Columns.Count - 1
' Create a hash table containing all the groups
' needed for a single column.
groupTables(column) = CreateGroupsTable(column)
Next column
' Start with the groups created for the Title column.
SetGroups(0)
End If
' Initialize the form.
Me.Controls.Add(myListView)
Me.Size = New System.Drawing.Size(550, 330)
Me.Text = "ListView Groups Example"
End Sub
<STAThread()> _
Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New ListViewGroupsExample())
End Sub
' Groups the items using the groups created for the clicked
' column.
Private Sub myListView_ColumnClick( _
sender As Object, e As ColumnClickEventArgs)
' Set the sort order to ascending when changing
' column groups; otherwise, reverse the sort order.
If myListView.Sorting = SortOrder.Descending OrElse _
isRunningXPOrLater And e.Column <> groupColumn Then
myListView.Sorting = SortOrder.Ascending
Else
myListView.Sorting = SortOrder.Descending
End If
groupColumn = e.Column
' Set the groups to those created for the clicked column.
If isRunningXPOrLater Then
SetGroups(e.Column)
End If
End Sub
' Sets myListView to the groups created for the specified column.
Private Sub SetGroups(column As Integer)
' Remove the current groups.
myListView.Groups.Clear()
' Retrieve the hash table corresponding to the column.
Dim groups As Hashtable = CType(groupTables(column), Hashtable)
' Copy the groups for the column to an array.
Dim groupsArray(groups.Count - 1) As ListViewGroup
groups.Values.CopyTo(groupsArray, 0)
' Sort the groups and add them to myListView.
Array.Sort(groupsArray, New ListViewGroupSorter(myListView.Sorting))
myListView.Groups.AddRange(groupsArray)
' Iterate through the items in myListView, assigning each
' one to the appropriate group.
Dim item As ListViewItem
For Each item In myListView.Items
' Retrieve the subitem text corresponding to the column.
Dim subItemText As String = item.SubItems(column).Text
' For the Title column, use only the first letter.
If column = 0 Then
subItemText = subItemText.Substring(0, 1)
End If
' Assign the item to the matching group.
item.Group = CType(groups(subItemText), ListViewGroup)
Next item
End Sub
' Creates a Hashtable object with one entry for each unique
' subitem value (or initial letter for the parent item)
' in the specified column.
Private Function CreateGroupsTable(column As Integer) As Hashtable
' Create a Hashtable object.
Dim groups As New Hashtable()
' Iterate through the items in myListView.
Dim item As ListViewItem
For Each item In myListView.Items
' Retrieve the text value for the column.
Dim subItemText As String = item.SubItems(column).Text
' Use the initial letter instead if it is the first column.
If column = 0 Then
subItemText = subItemText.Substring(0, 1)
End If
' If the groups table does not already contain a group
' for the subItemText value, add a new group using the
' subItemText value for the group header and Hashtable key.
If Not groups.Contains(subItemText) Then
groups.Add( subItemText, New ListViewGroup(subItemText, _
HorizontalAlignment.Left) )
End If
Next item
' Return the Hashtable object.
Return groups
End Function 'CreateGroupsTable
' Sorts ListViewGroup objects by header value.
Private Class ListViewGroupSorter
Implements IComparer
Private order As SortOrder
' Stores the sort order.
Public Sub New(theOrder As SortOrder)
order = theOrder
End Sub
' Compares the groups by header value, using the saved sort
' order to return the correct value.
Public Function Compare(x As Object, y As Object) As Integer _
Implements IComparer.Compare
Dim result As Integer = String.Compare( _
CType(x, ListViewGroup).Header, _
CType(y, ListViewGroup).Header )
If order = SortOrder.Ascending Then
Return result
Else
Return -result
End If
End Function 'Compare
End Class
End Class
Комментарии
ListView.Groups Используйте свойство для получения связанного ListViewGroupCollection с элементом ListView управления. Эта коллекция содержит ListViewGroup объекты, представляющие группы, отображаемые в элементе управления, когда ListView.View свойство имеет значение, отличное от View.Listзначения. Все элементы, которые не назначены группе, будут отображаться в группе по умолчанию, которая имеет метку заголовка DefaultGroup{0}. Группа по умолчанию не содержится в ListView.Groups коллекции и не может быть изменена. В первую очередь полезно выполнить отладку, чтобы убедиться, что все элементы были правильно добавлены в группы. Если в ListView.Groups коллекции нет групп, функция группирования отключена.
Add Используйте метод для добавления одной группы в коллекцию. Insert Используйте метод для добавления группы по определенному индексу в коллекции. Чтобы удалить группу Remove , используйте этот метод. RemoveAt Используйте метод, чтобы удалить группу по определенному индексу.
Невозможно добавить в ListViewGroup коллекцию несколько раз. Чтобы изменить положение группы в коллекции, сначала ее необходимо удалить из коллекции, а затем вставить в нужное расположение. Contains Используйте метод, чтобы определить, уже ли определенная группа находится в коллекции. Чтобы получить индекс группы в коллекции, используйте IndexOf этот метод. Вы можете получить или задать группу по определенному индексу Item[] с помощью индексатора.
AddRange Используйте метод для добавления нескольких групп в коллекцию. Можно добавить несколько групп в виде массива групп или в качестве ListViewGroupCollection полученного ListView.Groups через свойство другого ListView элемента управления. Clear Используйте метод для удаления всех групп из коллекции.
Замечание
Методы Removeи Clear методы удаляют группы из коллекции, но не удаляют элементы из ListView элемента управления. RemoveAt Если в ListView.Groups коллекции нет групп, функция группирования отключена, а все элементы элемента управления отображаются нормально.
Clear Методы AddRange полезны, если требуется предоставить несколько способов группировки элементов в элементе ListView управления. Для этого создайте несколько массивов групп. Чтобы изменить группирование, сначала используйте Clear метод для удаления всех групп из коллекции, а затем используйте AddRange метод для добавления следующего массива групп для отображения.
CopyTo Используйте метод для копирования групп в коллекцию в совместимый массив, начиная с указанного индекса. Это полезно, например, если вы хотите сортировать группы в коллекции с помощью Array.Sort метода. Для этого скопируйте группы в совместимый массив, а затем сортируйте массив. Затем используйте Clear метод для удаления всех групп из коллекции, а затем используйте AddRange метод для добавления отсортированного массива обратно в коллекцию.
Count Используйте свойство, чтобы определить, сколько групп находится в коллекции. Чтобы выполнить итерацию по коллекции, используйте IEnumerator возвращаемый метод GetEnumerator .
Замечание
Функция группировки доступна только в Windows XP и семействе Windows Server 2003, когда приложение вызывает Application.EnableVisualStyles метод. В более ранних операционных системах любой код, связанный с группами, будет игнорироваться, и группы не будут отображаться. В результате любой код, зависящий от функции группировки, может работать неправильно. Возможно, потребуется включить тест, определяющий, доступна ли функция группировки, и предоставить альтернативные функции, если она недоступна. Например, при выполнении в операционных системах, которые не поддерживают сортировку по группам, может потребоваться предоставить альтернативные сортировки.
Функция метки вставки предоставляется той же библиотекой, которая предоставляет функцию тем операционной системы. Чтобы проверить доступность этой библиотеки, вызовите перегрузку метода и передайте FeatureSupport.IsPresent(Object)OSFeature.Themes значение.
Свойства
| Имя | Описание |
|---|---|
| Count |
Возвращает количество групп в коллекции. |
| Item[Int32] |
Возвращает или задает ListViewGroup указанный индекс в коллекции. |
| Item[String] |
Возвращает или задает ListViewGroup значение указанного Name свойства. |
Методы
| Имя | Описание |
|---|---|
| Add(ListViewGroup) |
Добавляет указанный ListViewGroup в коллекцию. |
| Add(String, String) |
Добавляет новую ListViewGroup в коллекцию с помощью указанных значений для инициализации Name и Header свойств. |
| AddRange(ListViewGroup[]) |
Добавляет массив групп в коллекцию. |
| AddRange(ListViewGroupCollection) |
Добавляет группы в существующую ListViewGroupCollection коллекцию. |
| Clear() |
Удаляет все группы из коллекции. |
| Contains(ListViewGroup) |
Определяет, находится ли указанная группа в коллекции. |
| CopyTo(Array, Int32) |
Копирует группы в коллекцию в совместимую одномерную, Arrayначиная с указанного индекса целевого массива. |
| Equals(Object) |
Определяет, равен ли указанный объект текущему объекту. (Унаследовано от Object) |
| GetEnumerator() |
Возвращает перечислитель, используемый для итерации по коллекции. |
| GetHashCode() |
Служит хэш-функцией по умолчанию. (Унаследовано от Object) |
| GetType() |
Возвращает Type текущего экземпляра. (Унаследовано от Object) |
| IndexOf(ListViewGroup) |
Возвращает индекс указанного ListViewGroup в коллекции. |
| Insert(Int32, ListViewGroup) |
Вставляет указанный ListViewGroup объект в коллекцию по указанному индексу. |
| MemberwiseClone() |
Создает неглубокую копию текущей Object. (Унаследовано от Object) |
| Remove(ListViewGroup) |
Удаляет указанный ListViewGroup из коллекции. |
| RemoveAt(Int32) |
Удаляет ListViewGroup указанный индекс в коллекции. |
| ToString() |
Возвращает строку, представляющую текущий объект. (Унаследовано от Object) |
Явные реализации интерфейса
| Имя | Описание |
|---|---|
| ICollection.IsSynchronized |
Возвращает значение, указывающее, синхронизирован ли доступ к коллекции (потокобезопасный). |
| ICollection.SyncRoot |
Возвращает объект, который можно использовать для синхронизации доступа к коллекции. |
| IList.Add(Object) |
Добавляет новый ListViewGroup объект ListViewGroupCollectionв . |
| IList.Contains(Object) |
Определяет, находится ли указанное значение в коллекции. |
| IList.IndexOf(Object) |
Возвращает индекс в коллекции указанного значения. |
| IList.Insert(Int32, Object) |
Вставляется в ListViewGroup элемент ListViewGroupCollection. |
| IList.IsFixedSize |
Возвращает значение, указывающее, имеет ли коллекция фиксированный размер. |
| IList.IsReadOnly |
Возвращает значение, указывающее, доступна ли коллекция только для чтения. |
| IList.Item[Int32] |
Возвращает или задает ListViewGroup указанный индекс в коллекции. |
| IList.Remove(Object) |
Удаляется ListViewGroup из .ListViewGroupCollection |
Методы расширения
| Имя | Описание |
|---|---|
| AsParallel(IEnumerable) |
Включает параллелизацию запроса. |
| AsQueryable(IEnumerable) |
Преобразует IEnumerable в IQueryable. |
| Cast<TResult>(IEnumerable) |
Приведение элементов IEnumerable к указанному типу. |
| OfType<TResult>(IEnumerable) |
Фильтрует элементы IEnumerable на основе указанного типа. |