Udostępnij za pośrednictwem


LinkedList<T> Klasa

Definicja

Reprezentuje podwójnie połączoną listę.

generic <typename T>
public ref class LinkedList : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::ICollection
generic <typename T>
public ref class LinkedList : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::ICollection, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
generic <typename T>
public ref class LinkedList : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::ICollection, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
generic <typename T>
public ref class LinkedList : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::ICollection
public class LinkedList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.ICollection
public class LinkedList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
public class LinkedList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
public class LinkedList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.ICollection, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
public class LinkedList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.ICollection
type LinkedList<'T> = class
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyCollection<'T>
    interface ICollection
type LinkedList<'T> = class
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IReadOnlyCollection<'T>
    interface ICollection
    interface IDeserializationCallback
    interface ISerializable
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Serializable>]
type LinkedList<'T> = class
    interface ICollection<'T>
    interface seq<'T>
    interface ICollection
    interface IEnumerable
    interface ISerializable
    interface IDeserializationCallback
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Serializable>]
type LinkedList<'T> = class
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface ICollection
    interface IReadOnlyCollection<'T>
    interface ISerializable
    interface IDeserializationCallback
type LinkedList<'T> = class
    interface ICollection<'T>
    interface seq<'T>
    interface ICollection
    interface IEnumerable
Public Class LinkedList(Of T)
Implements ICollection, ICollection(Of T), IEnumerable(Of T), IReadOnlyCollection(Of T)
Public Class LinkedList(Of T)
Implements ICollection, ICollection(Of T), IDeserializationCallback, IEnumerable(Of T), IReadOnlyCollection(Of T), ISerializable
Public Class LinkedList(Of T)
Implements ICollection, ICollection(Of T), IDeserializationCallback, IEnumerable(Of T), ISerializable
Public Class LinkedList(Of T)
Implements ICollection, ICollection(Of T), IEnumerable(Of T)

Parametry typu

T

Określa typ elementu połączonej listy.

Dziedziczenie
LinkedList<T>
Atrybuty
Implementuje

Przykłady

Poniższy przykład kodu przedstawia wiele funkcji klasy LinkedList<T>.

#using <System.dll>

using namespace System;
using namespace System::Text;
using namespace System::Collections::Generic;

public ref class Example
{
public:
    static void Main()
    {
        // Create the link list.
        array<String^>^ words =
            { "the", "fox", "jumped", "over", "the", "dog" };
        LinkedList<String^>^ sentence = gcnew LinkedList<String^>(words);
        Display(sentence, "The linked list values:");
        Console::WriteLine("sentence.Contains(\"jumped\") = {0}",
            sentence->Contains("jumped"));

        // Add the word 'today' to the beginning of the linked list.
        sentence->AddFirst("today");
        Display(sentence, "Test 1: Add 'today' to beginning of the list:");

        // Move the first node to be the last node.
        LinkedListNode<String^>^ mark1 = sentence->First;
        sentence->RemoveFirst();
        sentence->AddLast(mark1);
        Display(sentence, "Test 2: Move first node to be last node:");

        // Change the last node to 'yesterday'.
        sentence->RemoveLast();
        sentence->AddLast("yesterday");
        Display(sentence, "Test 3: Change the last node to 'yesterday':");

        // Move the last node to be the first node.
        mark1 = sentence->Last;
        sentence->RemoveLast();
        sentence->AddFirst(mark1);
        Display(sentence, "Test 4: Move last node to be first node:");


        // Indicate the last occurence of 'the'.
        sentence->RemoveFirst();
        LinkedListNode<String^>^ current = sentence->FindLast("the");
        IndicateNode(current, "Test 5: Indicate last occurence of 'the':");

        // Add 'lazy' and 'old' after 'the' (the LinkedListNode named current).
        sentence->AddAfter(current, "old");
        sentence->AddAfter(current, "lazy");
        IndicateNode(current, "Test 6: Add 'lazy' and 'old' after 'the':");

        // Indicate 'fox' node.
        current = sentence->Find("fox");
        IndicateNode(current, "Test 7: Indicate the 'fox' node:");

        // Add 'quick' and 'brown' before 'fox':
        sentence->AddBefore(current, "quick");
        sentence->AddBefore(current, "brown");
        IndicateNode(current, "Test 8: Add 'quick' and 'brown' before 'fox':");

        // Keep a reference to the current node, 'fox',
        // and to the previous node in the list. Indicate the 'dog' node.
        mark1 = current;
        LinkedListNode<String^>^ mark2 = current->Previous;
        current = sentence->Find("dog");
        IndicateNode(current, "Test 9: Indicate the 'dog' node:");

        // The AddBefore method throws an InvalidOperationException
        // if you try to add a node that already belongs to a list.
        Console::WriteLine("Test 10: Throw exception by adding node (fox) already in the list:");
        try
        {
            sentence->AddBefore(current, mark1);
        }
        catch (InvalidOperationException^ ex)
        {
            Console::WriteLine("Exception message: {0}", ex->Message);
        }
        Console::WriteLine();

        // Remove the node referred to by mark1, and then add it
        // before the node referred to by current.
        // Indicate the node referred to by current.
        sentence->Remove(mark1);
        sentence->AddBefore(current, mark1);
        IndicateNode(current, "Test 11: Move a referenced node (fox) before the current node (dog):");

        // Remove the node referred to by current.
        sentence->Remove(current);
        IndicateNode(current, "Test 12: Remove current node (dog) and attempt to indicate it:");

        // Add the node after the node referred to by mark2.
        sentence->AddAfter(mark2, current);
        IndicateNode(current, "Test 13: Add node removed in test 11 after a referenced node (brown):");

        // The Remove method finds and removes the
        // first node that that has the specified value.
        sentence->Remove("old");
        Display(sentence, "Test 14: Remove node that has the value 'old':");

        // When the linked list is cast to ICollection(Of String),
        // the Add method adds a node to the end of the list.
        sentence->RemoveLast();
        ICollection<String^>^ icoll = sentence;
        icoll->Add("rhinoceros");
        Display(sentence, "Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':");

        Console::WriteLine("Test 16: Copy the list to an array:");
        // Create an array with the same number of
        // elements as the inked list.
        array<String^>^ sArray = gcnew array<String^>(sentence->Count);
        sentence->CopyTo(sArray, 0);

        for each (String^ s in sArray)
        {
            Console::WriteLine(s);
        }


        // Release all the nodes.
        sentence->Clear();

        Console::WriteLine();
        Console::WriteLine("Test 17: Clear linked list. Contains 'jumped' = {0}",
            sentence->Contains("jumped"));

        Console::ReadLine();
    }

private:
    static void Display(LinkedList<String^>^ words, String^ test)
    {
        Console::WriteLine(test);
        for each (String^ word in words)
        {
            Console::Write(word + " ");
        }
        Console::WriteLine();
        Console::WriteLine();
    }

    static void IndicateNode(LinkedListNode<String^>^ node, String^ test)
    {
        Console::WriteLine(test);
        if (node->List == nullptr)
        {
            Console::WriteLine("Node '{0}' is not in the list.\n",
                node->Value);
            return;
        }

        StringBuilder^ result = gcnew StringBuilder("(" + node->Value + ")");
        LinkedListNode<String^>^ nodeP = node->Previous;

        while (nodeP != nullptr)
        {
            result->Insert(0, nodeP->Value + " ");
            nodeP = nodeP->Previous;
        }

        node = node->Next;
        while (node != nullptr)
        {
            result->Append(" " + node->Value);
            node = node->Next;
        }

        Console::WriteLine(result);
        Console::WriteLine();
    }
};

int main()
{
    Example::Main();
}

//This code example produces the following output:
//
//The linked list values:
//the fox jumped over the dog

//Test 1: Add 'today' to beginning of the list:
//today the fox jumped over the dog

//Test 2: Move first node to be last node:
//the fox jumped over the dog today

//Test 3: Change the last node to 'yesterday':
//the fox jumped over the dog yesterday

//Test 4: Move last node to be first node:
//yesterday the fox jumped over the dog

//Test 5: Indicate last occurence of 'the':
//the fox jumped over (the) dog

//Test 6: Add 'lazy' and 'old' after 'the':
//the fox jumped over (the) lazy old dog

//Test 7: Indicate the 'fox' node:
//the (fox) jumped over the lazy old dog

//Test 8: Add 'quick' and 'brown' before 'fox':
//the quick brown (fox) jumped over the lazy old dog

//Test 9: Indicate the 'dog' node:
//the quick brown fox jumped over the lazy old (dog)

//Test 10: Throw exception by adding node (fox) already in the list:
//Exception message: The LinkedList node belongs a LinkedList.

//Test 11: Move a referenced node (fox) before the current node (dog):
//the quick brown jumped over the lazy old fox (dog)

//Test 12: Remove current node (dog) and attempt to indicate it:
//Node 'dog' is not in the list.

//Test 13: Add node removed in test 11 after a referenced node (brown):
//the quick brown (dog) jumped over the lazy old fox

//Test 14: Remove node that has the value 'old':
//the quick brown dog jumped over the lazy fox

//Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':
//the quick brown dog jumped over the lazy rhinoceros

//Test 16: Copy the list to an array:
//the
//quick
//brown
//dog
//jumped
//over
//the
//lazy
//rhinoceros

//Test 17: Clear linked list. Contains 'jumped' = False
//
using System;
using System.Text;
using System.Collections.Generic;

public class Example
{
    public static void Main()
    {
        // Create the link list.
        string[] words =
            { "the", "fox", "jumps", "over", "the", "dog" };
        LinkedList<string> sentence = new LinkedList<string>(words);
        Display(sentence, "The linked list values:");

        // Add the word 'today' to the beginning of the linked list.
        sentence.AddFirst("today");
        Display(sentence, "Test 1: Add 'today' to beginning of the list:");

        // Move the first node to be the last node.
        LinkedListNode<string> mark1 = sentence.First;
        sentence.RemoveFirst();
        sentence.AddLast(mark1);
        Display(sentence, "Test 2: Move first node to be last node:");

        // Change the last node to 'yesterday'.
        sentence.RemoveLast();
        sentence.AddLast("yesterday");
        Display(sentence, "Test 3: Change the last node to 'yesterday':");

        // Move the last node to be the first node.
        mark1 = sentence.Last;
        sentence.RemoveLast();
        sentence.AddFirst(mark1);
        Display(sentence, "Test 4: Move last node to be first node:");

        // Indicate the last occurence of 'the'.
        sentence.RemoveFirst();
        LinkedListNode<string> current = sentence.FindLast("the");
        IndicateNode(current, "Test 5: Indicate last occurence of 'the':");

        // Add 'lazy' and 'old' after 'the' (the LinkedListNode named current).
        sentence.AddAfter(current, "old");
        sentence.AddAfter(current, "lazy");
        IndicateNode(current, "Test 6: Add 'lazy' and 'old' after 'the':");

        // Indicate 'fox' node.
        current = sentence.Find("fox");
        IndicateNode(current, "Test 7: Indicate the 'fox' node:");

        // Add 'quick' and 'brown' before 'fox':
        sentence.AddBefore(current, "quick");
        sentence.AddBefore(current, "brown");
        IndicateNode(current, "Test 8: Add 'quick' and 'brown' before 'fox':");

        // Keep a reference to the current node, 'fox',
        // and to the previous node in the list. Indicate the 'dog' node.
        mark1 = current;
        LinkedListNode<string> mark2 = current.Previous;
        current = sentence.Find("dog");
        IndicateNode(current, "Test 9: Indicate the 'dog' node:");

        // The AddBefore method throws an InvalidOperationException
        // if you try to add a node that already belongs to a list.
        Console.WriteLine("Test 10: Throw exception by adding node (fox) already in the list:");
        try
        {
            sentence.AddBefore(current, mark1);
        }
        catch (InvalidOperationException ex)
        {
            Console.WriteLine("Exception message: {0}", ex.Message);
        }
        Console.WriteLine();

        // Remove the node referred to by mark1, and then add it
        // before the node referred to by current.
        // Indicate the node referred to by current.
        sentence.Remove(mark1);
        sentence.AddBefore(current, mark1);
        IndicateNode(current, "Test 11: Move a referenced node (fox) before the current node (dog):");

        // Remove the node referred to by current.
        sentence.Remove(current);
        IndicateNode(current, "Test 12: Remove current node (dog) and attempt to indicate it:");

        // Add the node after the node referred to by mark2.
        sentence.AddAfter(mark2, current);
        IndicateNode(current, "Test 13: Add node removed in test 11 after a referenced node (brown):");

        // The Remove method finds and removes the
        // first node that that has the specified value.
        sentence.Remove("old");
        Display(sentence, "Test 14: Remove node that has the value 'old':");

        // When the linked list is cast to ICollection(Of String),
        // the Add method adds a node to the end of the list.
        sentence.RemoveLast();
        ICollection<string> icoll = sentence;
        icoll.Add("rhinoceros");
        Display(sentence, "Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':");

        Console.WriteLine("Test 16: Copy the list to an array:");
        // Create an array with the same number of
        // elements as the linked list.
        string[] sArray = new string[sentence.Count];
        sentence.CopyTo(sArray, 0);

        foreach (string s in sArray)
        {
            Console.WriteLine(s);
        }

        Console.WriteLine("Test 17: linked list Contains 'jumps' = {0}",
            sentence.Contains("jumps"));
        
        // Release all the nodes.
        sentence.Clear();

        Console.WriteLine();
        Console.WriteLine("Test 18: Cleared linked list Contains 'jumps' = {0}",
            sentence.Contains("jumps"));

        Console.ReadLine();
    }

    private static void Display(LinkedList<string> words, string test)
    {
        Console.WriteLine(test);
        foreach (string word in words)
        {
            Console.Write(word + " ");
        }
        Console.WriteLine();
        Console.WriteLine();
    }

    private static void IndicateNode(LinkedListNode<string> node, string test)
    {
        Console.WriteLine(test);
        if (node.List == null)
        {
            Console.WriteLine("Node '{0}' is not in the list.\n",
                node.Value);
            return;
        }

        StringBuilder result = new StringBuilder("(" + node.Value + ")");
        LinkedListNode<string> nodeP = node.Previous;

        while (nodeP != null)
        {
            result.Insert(0, nodeP.Value + " ");
            nodeP = nodeP.Previous;
        }

        node = node.Next;
        while (node != null)
        {
            result.Append(" " + node.Value);
            node = node.Next;
        }

        Console.WriteLine(result);
        Console.WriteLine();
    }
}

//This code example produces the following output:
//
//The linked list values:
//the fox jumps over the dog

//Test 1: Add 'today' to beginning of the list:
//today the fox jumps over the dog

//Test 2: Move first node to be last node:
//the fox jumps over the dog today

//Test 3: Change the last node to 'yesterday':
//the fox jumps over the dog yesterday

//Test 4: Move last node to be first node:
//yesterday the fox jumps over the dog

//Test 5: Indicate last occurence of 'the':
//the fox jumps over (the) dog

//Test 6: Add 'lazy' and 'old' after 'the':
//the fox jumps over (the) lazy old dog

//Test 7: Indicate the 'fox' node:
//the (fox) jumps over the lazy old dog

//Test 8: Add 'quick' and 'brown' before 'fox':
//the quick brown (fox) jumps over the lazy old dog

//Test 9: Indicate the 'dog' node:
//the quick brown fox jumps over the lazy old (dog)

//Test 10: Throw exception by adding node (fox) already in the list:
//Exception message: The LinkedList node belongs a LinkedList.

//Test 11: Move a referenced node (fox) before the current node (dog):
//the quick brown jumps over the lazy old fox (dog)

//Test 12: Remove current node (dog) and attempt to indicate it:
//Node 'dog' is not in the list.

//Test 13: Add node removed in test 11 after a referenced node (brown):
//the quick brown (dog) jumps over the lazy old fox

//Test 14: Remove node that has the value 'old':
//the quick brown dog jumps over the lazy fox

//Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':
//the quick brown dog jumps over the lazy rhinoceros

//Test 16: Copy the list to an array:
//the
//quick
//brown
//dog
//jumps
//over
//the
//lazy
//rhinoceros

//Test 17: linked list Contains 'jumps'= True

//Test 18: Cleared linked list Contains 'jumps'  = False
//
Imports System.Text
Imports System.Collections.Generic
Public Class Example

    Public Shared Sub Main()
        ' Create the link list.
        Dim words() As String = {"the", "fox", _
            "jumps", "over", "the", "dog"}
        Dim sentence As New LinkedList(Of String)(words)
        Console.WriteLine("sentence.Contains(""jumps"") = {0}", _
            sentence.Contains("jumps"))
        Display(sentence, "The linked list values:")
        ' Add the word 'today' to the beginning of the linked list.
        sentence.AddFirst("today")
        Display(sentence, "Test 1: Add 'today' to beginning of the list:")
        ' Move the first node to be the last node.
        Dim mark1 As LinkedListNode(Of String) = sentence.First
        sentence.RemoveFirst()
        sentence.AddLast(mark1)
        Display(sentence, "Test 2: Move first node to be last node:")
        ' Change the last node to 'yesterday'.
        sentence.RemoveLast()
        sentence.AddLast("yesterday")
        Display(sentence, "Test 3: Change the last node to 'yesterday':")
        ' Move the last node to be the first node.
        mark1 = sentence.Last
        sentence.RemoveLast()
        sentence.AddFirst(mark1)
        Display(sentence, "Test 4: Move last node to be first node:")
        ' Indicate the last occurence of 'the'.
        sentence.RemoveFirst()
        Dim current As LinkedListNode(Of String) = sentence.FindLast("the")
        IndicateNode(current, "Test 5: Indicate last occurence of 'the':")
        ' Add 'lazy' and 'old' after 'the' (the LinkedListNode named current).
        sentence.AddAfter(current, "old")
        sentence.AddAfter(current, "lazy")
        IndicateNode(current, "Test 6: Add 'lazy' and 'old' after 'the':")
        ' Indicate 'fox' node.
        current = sentence.Find("fox")
        IndicateNode(current, "Test 7: Indicate the 'fox' node:")
        ' Add 'quick' and 'brown' before 'fox':
        sentence.AddBefore(current, "quick")
        sentence.AddBefore(current, "brown")
        IndicateNode(current, "Test 8: Add 'quick' and 'brown' before 'fox':")
        ' Keep a reference to the current node, 'fox',
        ' and to the previous node in the list. Indicate the 'dog' node.
        mark1 = current
        Dim mark2 As LinkedListNode(Of String) = current.Previous
        current = sentence.Find("dog")
        IndicateNode(current, "Test 9: Indicate the 'dog' node:")
        ' The AddBefore method throws an InvalidOperationException
        ' if you try to add a node that already belongs to a list.
        Console.WriteLine("Test 10: Throw exception by adding node (fox) already in the list:")
        Try
            sentence.AddBefore(current, mark1)
        Catch ex As InvalidOperationException
            Console.WriteLine("Exception message: {0}", ex.Message)
        End Try
        Console.WriteLine()
        ' Remove the node referred to by mark1, and then add it
        ' before the node referred to by current.
        ' Indicate the node referred to by current.
        sentence.Remove(mark1)
        sentence.AddBefore(current, mark1)
        IndicateNode(current, "Test 11: Move a referenced node (fox) before the current node (dog):")
        ' Remove the node referred to by current. 
        sentence.Remove(current)
        IndicateNode(current, "Test 12: Remove current node (dog) and attempt to indicate it:")
        ' Add the node after the node referred to by mark2.
        sentence.AddAfter(mark2, current)
        IndicateNode(current, "Test 13: Add node removed in test 11 after a referenced node (brown):")
        ' The Remove method finds and removes the
        ' first node that that has the specified value.
        sentence.Remove("old")
        Display(sentence, "Test 14: Remove node that has the value 'old':")
        ' When the linked list is cast to ICollection(Of String),
        ' the Add method adds a node to the end of the list.
        sentence.RemoveLast()
        Dim icoll As ICollection(Of String) = sentence
        icoll.Add("rhinoceros")
        Display(sentence, "Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':")
        Console.WriteLine("Test 16: Copy the list to an array:")
        ' Create an array with the same number of
        ' elements as the inked list.
        Dim sArray() As String = New String((sentence.Count) - 1) {}
        sentence.CopyTo(sArray, 0)
        For Each s As String In sArray
            Console.WriteLine(s)
        Next

        ' Release all the nodes.
        sentence.Clear()
        Console.WriteLine()
        Console.WriteLine("Test 17: Clear linked list. Contains 'jumps' = {0}", sentence.Contains("jumps"))
        Console.ReadLine()
    End Sub

    Private Shared Sub Display(ByVal words As LinkedList(Of String), ByVal test As String)
        Console.WriteLine(test)
        For Each word As String In words
            Console.Write((word + " "))
        Next
        Console.WriteLine()
        Console.WriteLine()
    End Sub

    Private Shared Sub IndicateNode(ByVal node As LinkedListNode(Of String), ByVal test As String)
        Console.WriteLine(test)
        If IsNothing(node.List) Then
            Console.WriteLine("Node '{0}' is not in the list." & vbLf, node.Value)
            Return
        End If
        Dim result As StringBuilder = New StringBuilder(("(" _
                        + (node.Value + ")")))
        Dim nodeP As LinkedListNode(Of String) = node.Previous

        While (Not (nodeP) Is Nothing)
            result.Insert(0, (nodeP.Value + " "))
            nodeP = nodeP.Previous

        End While
        node = node.Next

        While (Not (node) Is Nothing)
            result.Append((" " + node.Value))
            node = node.Next

        End While
        Console.WriteLine(result)
        Console.WriteLine()
    End Sub
End Class
'This code example produces the following output:
'
'The linked list values:
'the fox jumps over the dog 
'Test 1: Add 'today' to beginning of the list:
'today the fox jumps over the dog

'Test 2: Move first node to be last node:
'the fox jumps over the dog today

'Test 3: Change the last node to 'yesterday':
'the fox jumps over the dog yesterday

'Test 4: Move last node to be first node:
'yesterday the fox jumps over the dog

'Test 5: Indicate last occurence of 'the':
'the fox jumps over (the) dog

'Test 6: Add 'lazy' and 'old' after 'the':
'the fox jumps over (the) lazy old dog

'Test 7: Indicate the 'fox' node:
'the (fox) jumps over the lazy old dog

'Test 8: Add 'quick' and 'brown' before 'fox':
'the quick brown (fox) jumps over the lazy old dog

'Test 9: Indicate the 'dog' node:
'the quick brown fox jumps over the lazy old (dog)

'Test 10: Throw exception by adding node (fox) already in the list:
'Exception message: The LinkedList node belongs a LinkedList.

'Test 11: Move a referenced node (fox) before the current node (dog):
'the quick brown jumps over the lazy old fox (dog)

'Test 12: Remove current node (dog) and attempt to indicate it:
'Node 'dog' is not in the list.

'Test 13: Add node removed in test 11 after a referenced node (brown):
'the quick brown (dog) jumps over the lazy old fox

'Test 14: Remove node that has the value 'old':
'the quick brown dog jumps over the lazy fox 

'Test 15: Remove last node, cast to ICollection, and add 'rhinoceros':
'the quick brown dog jumps over the lazy rhinoceros

'Test 16: Copy the list to an array:
'the
'quick
'brown
'dog
'jumps
'over
'the
'lazy
'rhinoceros

'Test 17: Clear linked list. Contains 'jumps' = False
'

Uwagi

LinkedList<T> jest listą połączoną ogólnego przeznaczenia. Obsługuje on moduły wyliczania i implementuje interfejs ICollection zgodny z innymi klasami kolekcji w programie .NET Framework.

LinkedList<T> udostępnia oddzielne węzły typu LinkedListNode<T>, dlatego operacje wstawiania i usuwania są operacjami O(1).

Można usunąć węzły i ponownie je przestawić na tej samej liście lub na innej liście, co powoduje, że nie przydzielono żadnych dodatkowych obiektów na stercie. Ponieważ lista obsługuje również liczbę wewnętrzną, pobieranie właściwości Count jest operacją O(1).

Każdy węzeł w obiekcie LinkedList<T> jest typu LinkedListNode<T>. Ponieważ LinkedList<T> jest podwójnie połączona, każdy węzeł wskazuje do przodu do węzła Next i do tyłu do węzła Previous.

Listy zawierające typy odwołań działają lepiej, gdy węzeł i jego wartość są tworzone w tym samym czasie. LinkedList<T> akceptuje null jako prawidłową właściwość Value dla typów odwołań i zezwala na zduplikowane wartości.

Jeśli LinkedList<T> jest pusta, właściwości First i Last zawierają null.

Klasa LinkedList<T> nie obsługuje tworzenia łańcuchów, dzielenia, cykli ani innych funkcji, które mogą pozostawić listę w stanie niespójnym. Lista pozostaje spójna w jednym wątku. Jedynym scenariuszem wielowątkowym obsługiwanym przez LinkedList<T> jest operacje odczytu wielowątkowego.

Konstruktory

LinkedList<T>()

Inicjuje nowe wystąpienie klasy LinkedList<T>, która jest pusta.

LinkedList<T>(IEnumerable<T>)

Inicjuje nowe wystąpienie klasy LinkedList<T> zawierającej elementy skopiowane z określonego IEnumerable i ma wystarczającą pojemność, aby pomieścić liczbę skopiowanych elementów.

LinkedList<T>(SerializationInfo, StreamingContext)
Przestarzałe.

Inicjuje nowe wystąpienie klasy LinkedList<T>, która można serializować przy użyciu określonej SerializationInfo i StreamingContext.

Właściwości

Count

Pobiera liczbę węzłów zawartych w LinkedList<T>.

First

Pobiera pierwszy węzeł LinkedList<T>.

Last

Pobiera ostatni węzeł LinkedList<T>.

Metody

AddAfter(LinkedListNode<T>, LinkedListNode<T>)

Dodaje określony nowy węzeł po określonym istniejącym węźle w LinkedList<T>.

AddAfter(LinkedListNode<T>, T)

Dodaje nowy węzeł zawierający określoną wartość po określonym węźle w LinkedList<T>.

AddBefore(LinkedListNode<T>, LinkedListNode<T>)

Dodaje określony nowy węzeł przed określonym istniejącym węzłem w LinkedList<T>.

AddBefore(LinkedListNode<T>, T)

Dodaje nowy węzeł zawierający określoną wartość przed określonym istniejącym węzłem w LinkedList<T>.

AddFirst(LinkedListNode<T>)

Dodaje określony nowy węzeł na początku LinkedList<T>.

AddFirst(T)

Dodaje nowy węzeł zawierający określoną wartość na początku LinkedList<T>.

AddLast(LinkedListNode<T>)

Dodaje określony nowy węzeł na końcu LinkedList<T>.

AddLast(T)

Dodaje nowy węzeł zawierający określoną wartość na końcu LinkedList<T>.

Clear()

Usuwa wszystkie węzły z LinkedList<T>.

Contains(T)

Określa, czy wartość znajduje się w LinkedList<T>.

CopyTo(T[], Int32)

Kopiuje całą LinkedList<T> do zgodnej jednowymiarowej Array, począwszy od określonego indeksu tablicy docelowej.

Equals(Object)

Określa, czy określony obiekt jest równy bieżącemu obiektowi.

(Odziedziczone po Object)
Find(T)

Znajduje pierwszy węzeł zawierający określoną wartość.

FindLast(T)

Znajduje ostatni węzeł zawierający określoną wartość.

GetEnumerator()

Zwraca moduł wyliczający, który iteruje przez LinkedList<T>.

GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetObjectData(SerializationInfo, StreamingContext)
Przestarzałe.

Implementuje interfejs ISerializable i zwraca dane potrzebne do serializacji wystąpienia LinkedList<T>.

GetType()

Pobiera Type bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Object.

(Odziedziczone po Object)
OnDeserialization(Object)

Implementuje interfejs ISerializable i zgłasza zdarzenie deserializacji po zakończeniu deserializacji.

Remove(LinkedListNode<T>)

Usuwa określony węzeł z LinkedList<T>.

Remove(T)

Usuwa pierwsze wystąpienie określonej wartości z LinkedList<T>.

RemoveFirst()

Usuwa węzeł na początku LinkedList<T>.

RemoveLast()

Usuwa węzeł na końcu LinkedList<T>.

ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

ICollection.CopyTo(Array, Int32)

Kopiuje elementy ICollection do Array, począwszy od określonego indeksu Array.

ICollection.IsSynchronized

Pobiera wartość wskazującą, czy dostęp do ICollection jest synchronizowany (bezpieczny wątek).

ICollection.SyncRoot

Pobiera obiekt, który może służyć do synchronizowania dostępu do ICollection.

ICollection<T>.Add(T)

Dodaje element na końcu ICollection<T>.

ICollection<T>.IsReadOnly

Pobiera wartość wskazującą, czy ICollection<T> jest tylko do odczytu.

IEnumerable.GetEnumerator()

Zwraca moduł wyliczający, który iteruje za pośrednictwem połączonej listy jako kolekcji.

IEnumerable<T>.GetEnumerator()

Zwraca moduł wyliczający, który iteruje za pośrednictwem kolekcji.

Metody rozszerzania

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy FrozenDictionary<TKey,TValue> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy.

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Tworzy FrozenDictionary<TKey,TValue> z IEnumerable<T> zgodnie z określonymi funkcjami selektora kluczy i selektora elementów.

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

Tworzy FrozenSet<T> z określonymi wartościami.

ToImmutableArray<TSource>(IEnumerable<TSource>)

Tworzy niezmienną tablicę z określonej kolekcji.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Tworzy niezmienny słownik z istniejącej kolekcji elementów, stosując funkcję przekształcania do kluczy źródłowych.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy niezmienny słownik na podstawie niektórych przekształceń sekwencji.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Wylicza i przekształca sekwencję oraz tworzy niezmienny słownik jego zawartości.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

Wylicza i przekształca sekwencję i tworzy niezmienny słownik jego zawartości przy użyciu określonego porównania kluczy.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Wylicza i przekształca sekwencję oraz tworzy niezmienny słownik jego zawartości przy użyciu określonych porównań kluczy i wartości.

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

Wylicza sekwencję i tworzy niezmienny zestaw skrótów jego zawartości.

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Wylicza sekwencję, tworzy niezmienny zestaw skrótów jego zawartości i używa określonego porównania równości dla typu zestawu.

ToImmutableList<TSource>(IEnumerable<TSource>)

Wylicza sekwencję i tworzy niezmienną listę jego zawartości.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Wylicza i przekształca sekwencję i tworzy niezmienny posortowany słownik jego zawartości.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

Wylicza i przekształca sekwencję i tworzy niezmienny posortowany słownik jego zawartości przy użyciu określonego porównania kluczy.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Wylicza i przekształca sekwencję oraz tworzy niezmienny posortowany słownik jego zawartości przy użyciu określonych porównań kluczy i wartości.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

Wylicza sekwencję i tworzy niezmienny posortowany zestaw jego zawartości.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

Wylicza sekwencję, tworzy niezmienialny zestaw posortowany jego zawartości i używa określonego porównania.

CopyToDataTable<T>(IEnumerable<T>)

Zwraca DataTable, który zawiera kopie obiektów DataRow, biorąc pod uwagę obiekt wejściowy IEnumerable<T>, w którym parametr ogólny T jest DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Kopiuje obiekty DataRow do określonego DataTable, biorąc pod uwagę obiekt wejściowy IEnumerable<T>, w którym parametr ogólny T jest DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Kopiuje obiekty DataRow do określonego DataTable, biorąc pod uwagę obiekt wejściowy IEnumerable<T>, w którym parametr ogólny T jest DataRow.

Aggregate<TSource>(IEnumerable<TSource>, Func<TSource,TSource,TSource>)

Stosuje funkcję akumulatorową w sekwencji.

Aggregate<TSource,TAccumulate>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>)

Stosuje funkcję akumulatorową w sekwencji. Określona wartość inicju jest używana jako początkowa wartość akumulatorowa.

Aggregate<TSource,TAccumulate,TResult>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, Func<TAccumulate,TResult>)

Stosuje funkcję akumulatorową w sekwencji. Określona wartość inicjatora jest używana jako początkowa wartość akumulowania, a określona funkcja służy do wybierania wartości wyniku.

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

Reprezentuje podwójnie połączoną listę.

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TKey,TAccumulate>, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

Reprezentuje podwójnie połączoną listę.

All<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Określa, czy wszystkie elementy sekwencji spełniają warunek.

Any<TSource>(IEnumerable<TSource>)

Określa, czy sekwencja zawiera jakiekolwiek elementy.

Any<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Określa, czy dowolny element sekwencji spełnia warunek.

Append<TSource>(IEnumerable<TSource>, TSource)

Dołącza wartość na końcu sekwencji.

AsEnumerable<TSource>(IEnumerable<TSource>)

Zwraca dane wejściowe wpisane jako IEnumerable<T>.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

Oblicza średnią sekwencji Decimal wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

Oblicza średnią sekwencji Double wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

Oblicza średnią sekwencji Int32 wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

Oblicza średnią sekwencji Int64 wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

Oblicza średnią sekwencji wartości dopuszczających wartość null Decimal, które są uzyskiwane przez wywołanie funkcji transform w każdym elemecie sekwencji wejściowej.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

Oblicza średnią sekwencji wartości dopuszczających wartość null Double, które są uzyskiwane przez wywołanie funkcji transform w każdym elemecie sekwencji wejściowej.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

Oblicza średnią sekwencji wartości dopuszczających wartość null Int32, które są uzyskiwane przez wywołanie funkcji transform w każdym elemecie sekwencji wejściowej.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

Oblicza średnią sekwencji wartości dopuszczających wartość null Int64, które są uzyskiwane przez wywołanie funkcji transform w każdym elemecie sekwencji wejściowej.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

Oblicza średnią sekwencji wartości dopuszczających wartość null Single, które są uzyskiwane przez wywołanie funkcji transform w każdym elemecie sekwencji wejściowej.

Average<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

Oblicza średnią sekwencji Single wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Cast<TResult>(IEnumerable)

Rzutuje elementy IEnumerable do określonego typu.

Chunk<TSource>(IEnumerable<TSource>, Int32)

Dzieli elementy sekwencji na fragmenty rozmiaru w większości size.

Concat<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

Łączy dwie sekwencje.

Contains<TSource>(IEnumerable<TSource>, TSource)

Określa, czy sekwencja zawiera określony element przy użyciu domyślnego modułu porównywania równości.

Contains<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

Określa, czy sekwencja zawiera określony element przy użyciu określonego IEqualityComparer<T>.

Count<TSource>(IEnumerable<TSource>)

Zwraca liczbę elementów w sekwencji.

Count<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca liczbę reprezentującą, ile elementów w określonej sekwencji spełnia warunek.

CountBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Reprezentuje podwójnie połączoną listę.

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

Zwraca elementy określonej sekwencji lub wartość domyślną parametru typu w kolekcji pojedynczej, jeśli sekwencja jest pusta.

DefaultIfEmpty<TSource>(IEnumerable<TSource>, TSource)

Zwraca elementy określonej sekwencji lub określoną wartość w kolekcji pojedynczej, jeśli sekwencja jest pusta.

Distinct<TSource>(IEnumerable<TSource>)

Zwraca różne elementy z sekwencji przy użyciu domyślnego modułu porównywania równości do porównywania wartości.

Distinct<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Zwraca różne elementy z sekwencji przy użyciu określonego IEqualityComparer<T> do porównywania wartości.

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Zwraca odrębne elementy z sekwencji zgodnie z określoną funkcją selektora kluczy.

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Zwraca różne elementy z sekwencji zgodnie z określoną funkcją selektora kluczy i przy użyciu określonego modułu porównującego do porównywania kluczy.

ElementAt<TSource>(IEnumerable<TSource>, Index)

Zwraca element w określonym indeksie w sekwencji.

ElementAt<TSource>(IEnumerable<TSource>, Int32)

Zwraca element w określonym indeksie w sekwencji.

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Index)

Zwraca element w określonym indeksie w sekwencji lub wartość domyślną, jeśli indeks jest poza zakresem.

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Int32)

Zwraca element w określonym indeksie w sekwencji lub wartość domyślną, jeśli indeks jest poza zakresem.

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

Tworzy różnicę zestawu dwóch sekwencji przy użyciu domyślnego porównywania równości do porównywania wartości.

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Tworzy różnicę zestawu dwóch sekwencji przy użyciu określonego IEqualityComparer<T> do porównywania wartości.

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

Tworzy różnicę zestawu dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy różnicę zestawu dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

First<TSource>(IEnumerable<TSource>)

Zwraca pierwszy element sekwencji.

First<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca pierwszy element w sekwencji, który spełnia określony warunek.

FirstOrDefault<TSource>(IEnumerable<TSource>)

Zwraca pierwszy element sekwencji lub wartość domyślną, jeśli sekwencja nie zawiera żadnych elementów.

FirstOrDefault<TSource>(IEnumerable<TSource>, TSource)

Zwraca pierwszy element sekwencji lub określoną wartość domyślną, jeśli sekwencja nie zawiera żadnych elementów.

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca pierwszy element sekwencji, który spełnia warunek lub wartość domyślną, jeśli taki element nie zostanie znaleziony.

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

Zwraca pierwszy element sekwencji, który spełnia warunek lub określoną wartość domyślną, jeśli taki element nie zostanie znaleziony.

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy.

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i porównuje klucze przy użyciu określonego porównania.

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i projektuje elementy dla każdej grupy przy użyciu określonej funkcji.

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Grupuje elementy sekwencji zgodnie z funkcją selektora klucza. Klucze są porównywane przy użyciu modułu porównującego, a elementy każdej grupy są projektowane przy użyciu określonej funkcji.

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i tworzy wartość wynikową z każdej grupy i jej klucza.

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>, IEqualityComparer<TKey>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i tworzy wartość wynikową z każdej grupy i jej klucza. Klucze są porównywane przy użyciu określonego porównania.

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>,TResult>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i tworzy wartość wynikową z każdej grupy i jej klucza. Elementy każdej grupy są projektowane przy użyciu określonej funkcji.

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

Grupuje elementy sekwencji zgodnie z określoną funkcją selektora kluczy i tworzy wartość wynikową z każdej grupy i jej klucza. Wartości klucza są porównywane przy użyciu określonego porównania, a elementy każdej grupy są przewidywane przy użyciu określonej funkcji.

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>)

Koreluje elementy dwóch sekwencji na podstawie równości kluczy i grupuje wyniki. Domyślny moduł porównywania równości służy do porównywania kluczy.

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)

Koreluje elementy dwóch sekwencji na podstawie równości klucza i grupuje wyniki. Określony IEqualityComparer<T> służy do porównywania kluczy.

Index<TSource>(IEnumerable<TSource>)

Zwraca wyliczenie, które uwzględnia indeks elementu w krotkę.

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

Tworzy przecięcie zestawu dwóch sekwencji przy użyciu domyślnego modułu porównywania równości do porównywania wartości.

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Tworzy przecięcie zestawu dwóch sekwencji przy użyciu określonego IEqualityComparer<T> do porównywania wartości.

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

Tworzy przecięcie zestawu dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy przecięcie zestawu dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

Koreluje elementy dwóch sekwencji na podstawie pasujących kluczy. Domyślny moduł porównywania równości służy do porównywania kluczy.

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

Koreluje elementy dwóch sekwencji na podstawie pasujących kluczy. Określony IEqualityComparer<T> służy do porównywania kluczy.

Last<TSource>(IEnumerable<TSource>)

Zwraca ostatni element sekwencji.

Last<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca ostatni element sekwencji, który spełnia określony warunek.

LastOrDefault<TSource>(IEnumerable<TSource>)

Zwraca ostatni element sekwencji lub wartość domyślną, jeśli sekwencja nie zawiera żadnych elementów.

LastOrDefault<TSource>(IEnumerable<TSource>, TSource)

Zwraca ostatni element sekwencji lub określoną wartość domyślną, jeśli sekwencja nie zawiera żadnych elementów.

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca ostatni element sekwencji, który spełnia warunek lub wartość domyślną, jeśli taki element nie zostanie znaleziony.

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

Zwraca ostatni element sekwencji, który spełnia warunek lub określoną wartość domyślną, jeśli taki element nie zostanie znaleziony.

LongCount<TSource>(IEnumerable<TSource>)

Zwraca Int64 reprezentującą łączną liczbę elementów w sekwencji.

LongCount<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca Int64 reprezentującą liczbę elementów w sekwencji spełniających warunek.

Max<TSource>(IEnumerable<TSource>)

Zwraca wartość maksymalną w sekwencji ogólnej.

Max<TSource>(IEnumerable<TSource>, IComparer<TSource>)

Zwraca wartość maksymalną w sekwencji ogólnej.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość Decimal.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość Double.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość Int32.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość Int64.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość dopuszczaną do wartości null Decimal.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość dopuszczaną do wartości null Double.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość dopuszczaną do wartości null Int32.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość dopuszczaną do wartości null Int64.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość dopuszczaną do wartości null Single.

Max<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca maksymalną wartość Single.

Max<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

Wywołuje funkcję transform dla każdego elementu sekwencji ogólnej i zwraca maksymalną wynikową wartość.

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Zwraca wartość maksymalną w sekwencji ogólnej zgodnie z określoną funkcją selektora kluczy.

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

Zwraca wartość maksymalną w sekwencji ogólnej zgodnie z określoną funkcją selektora kluczy i modułem porównującym klucz.

Min<TSource>(IEnumerable<TSource>)

Zwraca wartość minimalną w sekwencji ogólnej.

Min<TSource>(IEnumerable<TSource>, IComparer<TSource>)

Zwraca wartość minimalną w sekwencji ogólnej.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca minimalną wartość Decimal.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca minimalną wartość Double.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca minimalną wartość Int32.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca minimalną wartość Int64.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji i zwraca minimalną wartość dopuszczaną do wartości null Decimal.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji i zwraca minimalną wartość dopuszczaną do wartości null Double.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji i zwraca minimalną wartość dopuszczaną do wartości null Int32.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji i zwraca minimalną wartość dopuszczaną do wartości null Int64.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji i zwraca minimalną wartość dopuszczaną do wartości null Single.

Min<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

Wywołuje funkcję transform dla każdego elementu sekwencji i zwraca minimalną wartość Single.

Min<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

Wywołuje funkcję przekształcania dla każdego elementu sekwencji ogólnej i zwraca minimalną wynikową wartość.

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Zwraca wartość minimalną w sekwencji ogólnej zgodnie z określoną funkcją selektora kluczy.

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

Zwraca wartość minimalną w sekwencji ogólnej zgodnie z określoną funkcją selektora kluczy i modułem porównania kluczy.

OfType<TResult>(IEnumerable)

Filtruje elementy IEnumerable na podstawie określonego typu.

Order<T>(IEnumerable<T>)

Sortuje elementy sekwencji w kolejności rosnącej.

Order<T>(IEnumerable<T>, IComparer<T>)

Sortuje elementy sekwencji w kolejności rosnącej.

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Sortuje elementy sekwencji w kolejności rosnącej zgodnie z kluczem.

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

Sortuje elementy sekwencji w kolejności rosnącej przy użyciu określonego modułu porównania.

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Sortuje elementy sekwencji w kolejności malejącej zgodnie z kluczem.

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

Sortuje elementy sekwencji w kolejności malejącej przy użyciu określonego porównania.

OrderDescending<T>(IEnumerable<T>)

Sortuje elementy sekwencji w kolejności malejącej.

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

Sortuje elementy sekwencji w kolejności malejącej.

Prepend<TSource>(IEnumerable<TSource>, TSource)

Dodaje wartość na początku sekwencji.

Reverse<TSource>(IEnumerable<TSource>)

Odwraca kolejność elementów w sekwencji.

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

Projektuje każdy element sekwencji w nowym formularzu.

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,TResult>)

Projektuje każdy element sekwencji w nowym formularzu, dołączając indeks elementu.

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TResult>>)

Rzutuje każdy element sekwencji na IEnumerable<T> i spłaszcza sekwencje wynikowe w jedną sekwencję.

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TResult>>)

Projektuje każdy element sekwencji do IEnumerable<T>i spłaszcza wynikowe sekwencje w jedną sekwencję. Indeks każdego elementu źródłowego jest używany w przewidywanej formie tego elementu.

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

Projektuje każdy element sekwencji do IEnumerable<T>, spłaszcza wynikowe sekwencje w jedną sekwencję i wywołuje funkcję selektora wyników w każdym z nich.

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

Projektuje każdy element sekwencji do IEnumerable<T>, spłaszcza wynikowe sekwencje w jedną sekwencję i wywołuje funkcję selektora wyników w każdym z nich. Indeks każdego elementu źródłowego jest używany w pośredniej przewidywanej formie tego elementu.

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

Określa, czy dwie sekwencje są równe, porównując elementy przy użyciu domyślnego porównania równości dla ich typu.

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Określa, czy dwie sekwencje są równe, porównując ich elementy przy użyciu określonej IEqualityComparer<T>.

Single<TSource>(IEnumerable<TSource>)

Zwraca jedyny element sekwencji i zgłasza wyjątek, jeśli nie ma dokładnie jednego elementu w sekwencji.

Single<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca jedyny element sekwencji, który spełnia określony warunek, i zgłasza wyjątek, jeśli istnieje więcej niż jeden taki element.

SingleOrDefault<TSource>(IEnumerable<TSource>)

Zwraca jedyny element sekwencji lub wartość domyślną, jeśli sekwencja jest pusta; Ta metoda zgłasza wyjątek, jeśli w sekwencji znajduje się więcej niż jeden element.

SingleOrDefault<TSource>(IEnumerable<TSource>, TSource)

Zwraca jedyny element sekwencji lub określoną wartość domyślną, jeśli sekwencja jest pusta; Ta metoda zgłasza wyjątek, jeśli w sekwencji znajduje się więcej niż jeden element.

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca jedyny element sekwencji, który spełnia określony warunek lub wartość domyślną, jeśli taki element nie istnieje; Ta metoda zgłasza wyjątek, jeśli warunek spełnia więcej niż jeden element.

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

Zwraca jedyny element sekwencji, który spełnia określony warunek lub określoną wartość domyślną, jeśli taki element nie istnieje; Ta metoda zgłasza wyjątek, jeśli warunek spełnia więcej niż jeden element.

Skip<TSource>(IEnumerable<TSource>, Int32)

Pomija określoną liczbę elementów w sekwencji, a następnie zwraca pozostałe elementy.

SkipLast<TSource>(IEnumerable<TSource>, Int32)

Zwraca nową kolekcję wyliczalną zawierającą elementy z source z ostatnią count elementów pominiętej kolekcji źródłowej.

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Pomija elementy w sekwencji, o ile określony warunek jest spełniony, a następnie zwraca pozostałe elementy.

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

Pomija elementy w sekwencji, o ile określony warunek jest spełniony, a następnie zwraca pozostałe elementy. Indeks elementu jest używany w logice funkcji predykatu.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

Oblicza sumę sekwencji Decimal wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

Oblicza sumę sekwencji Double wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

Oblicza sumę sekwencji Int32 wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

Oblicza sumę sekwencji Int64 wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

Oblicza sumę sekwencji wartości dopuszczających wartość null Decimal, które są uzyskiwane przez wywołanie funkcji transform w poszczególnych elementach sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

Oblicza sumę sekwencji wartości dopuszczających wartość null Double, które są uzyskiwane przez wywołanie funkcji transform w poszczególnych elementach sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

Oblicza sumę sekwencji wartości dopuszczających wartość null Int32, które są uzyskiwane przez wywołanie funkcji transform w poszczególnych elementach sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

Oblicza sumę sekwencji wartości dopuszczających wartość null Int64, które są uzyskiwane przez wywołanie funkcji transform w poszczególnych elementach sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

Oblicza sumę sekwencji wartości dopuszczających wartość null Single, które są uzyskiwane przez wywołanie funkcji transform w poszczególnych elementach sekwencji danych wejściowych.

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

Oblicza sumę sekwencji Single wartości uzyskanych przez wywołanie funkcji transform w każdym elemecie sekwencji danych wejściowych.

Take<TSource>(IEnumerable<TSource>, Int32)

Zwraca określoną liczbę ciągłych elementów od początku sekwencji.

Take<TSource>(IEnumerable<TSource>, Range)

Zwraca określony zakres ciągłych elementów z sekwencji.

TakeLast<TSource>(IEnumerable<TSource>, Int32)

Zwraca nową kolekcję wyliczalną zawierającą ostatnie elementy count z source.

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Zwraca elementy z sekwencji, o ile określony warunek jest spełniony.

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

Zwraca elementy z sekwencji, o ile określony warunek jest spełniony. Indeks elementu jest używany w logice funkcji predykatu.

ToArray<TSource>(IEnumerable<TSource>)

Tworzy tablicę na podstawie IEnumerable<T>.

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Tworzy Dictionary<TKey,TValue> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy.

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy Dictionary<TKey,TValue> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy i modułem porównania kluczy.

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Tworzy Dictionary<TKey,TValue> z IEnumerable<T> zgodnie z określonymi funkcjami selektora kluczy i selektora elementów.

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Tworzy Dictionary<TKey,TValue> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy, modułem porównania i funkcją selektora elementów.

ToHashSet<TSource>(IEnumerable<TSource>)

Tworzy HashSet<T> na podstawie IEnumerable<T>.

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Tworzy HashSet<T> na podstawie IEnumerable<T> przy użyciu comparer do porównywania kluczy.

ToList<TSource>(IEnumerable<TSource>)

Tworzy List<T> na podstawie IEnumerable<T>.

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Tworzy Lookup<TKey,TElement> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy.

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy Lookup<TKey,TElement> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy i modułem porównania kluczy.

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

Tworzy Lookup<TKey,TElement> z IEnumerable<T> zgodnie z określonymi funkcjami selektora kluczy i selektora elementów.

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Tworzy Lookup<TKey,TElement> na podstawie IEnumerable<T> zgodnie z określoną funkcją selektora kluczy, modułem porównującym i funkcją selektora elementów.

TryGetNonEnumeratedCount<TSource>(IEnumerable<TSource>, Int32)

Próbuje określić liczbę elementów w sekwencji bez wymuszania wyliczenia.

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

Tworzy zestaw unii dwóch sekwencji przy użyciu domyślnego porównania równości.

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

Tworzy zbiór dwóch sekwencji przy użyciu określonej IEqualityComparer<T>.

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>)

Tworzy zestaw unii dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Tworzy zestaw unii dwóch sekwencji zgodnie z określoną funkcją selektora kluczy.

Where<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

Filtruje sekwencję wartości na podstawie predykatu.

Where<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

Filtruje sekwencję wartości na podstawie predykatu. Indeks każdego elementu jest używany w logice funkcji predykatu.

Zip<TFirst,TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>)

Tworzy sekwencję krotki z elementami z dwóch określonych sekwencji.

Zip<TFirst,TSecond,TThird>(IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>)

Tworzy sekwencję krotki z elementami z trzech określonych sekwencji.

Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)

Stosuje określoną funkcję do odpowiednich elementów dwóch sekwencji, tworząc sekwencję wyników.

AsParallel(IEnumerable)

Umożliwia równoległość zapytania.

AsParallel<TSource>(IEnumerable<TSource>)

Umożliwia równoległość zapytania.

AsQueryable(IEnumerable)

Konwertuje IEnumerable na IQueryable.

AsQueryable<TElement>(IEnumerable<TElement>)

Konwertuje ogólny IEnumerable<T> na ogólny IQueryable<T>.

Ancestors<T>(IEnumerable<T>)

Zwraca kolekcję elementów, które zawierają elementy podrzędne każdego węzła w kolekcji źródłowej.

Ancestors<T>(IEnumerable<T>, XName)

Zwraca odfiltrowaną kolekcję elementów, które zawierają elementy podrzędne każdego węzła w kolekcji źródłowej. W kolekcji znajdują się tylko elementy, które mają pasujący XName.

DescendantNodes<T>(IEnumerable<T>)

Zwraca kolekcję węzłów podrzędnych każdego dokumentu i elementu w kolekcji źródłowej.

Descendants<T>(IEnumerable<T>)

Zwraca kolekcję elementów, które zawierają elementy podrzędne każdego elementu i dokumentu w kolekcji źródłowej.

Descendants<T>(IEnumerable<T>, XName)

Zwraca filtrowaną kolekcję elementów, które zawierają elementy podrzędne każdego elementu i dokumentu w kolekcji źródłowej. W kolekcji znajdują się tylko elementy, które mają pasujący XName.

Elements<T>(IEnumerable<T>)

Zwraca kolekcję elementów podrzędnych każdego elementu i dokumentu w kolekcji źródłowej.

Elements<T>(IEnumerable<T>, XName)

Zwraca odfiltrowaną kolekcję elementów podrzędnych każdego elementu i dokumentu w kolekcji źródłowej. W kolekcji znajdują się tylko elementy, które mają pasujący XName.

InDocumentOrder<T>(IEnumerable<T>)

Zwraca kolekcję węzłów, która zawiera wszystkie węzły w kolekcji źródłowej posortowane w kolejności dokumentu.

Nodes<T>(IEnumerable<T>)

Zwraca kolekcję węzłów podrzędnych każdego dokumentu i elementu w kolekcji źródłowej.

Remove<T>(IEnumerable<T>)

Usuwa każdy węzeł w kolekcji źródłowej z węzła nadrzędnego.

Dotyczy

Bezpieczeństwo wątkowe

Ten typ nie jest bezpieczny wątkiem. Jeśli dostęp do LinkedList<T> wymaga wielu wątków, należy zaimplementować własny mechanizm synchronizacji.

LinkedList<T> może obsługiwać wiele czytników jednocześnie, o ile kolekcja nie zostanie zmodyfikowana. Mimo to wyliczanie za pośrednictwem kolekcji nie jest wewnętrznie procedurą bezpieczną wątkowo. W rzadkich przypadkach, gdy wyliczenie jest zgodne z dostępem do zapisu, kolekcja musi być zablokowana podczas całego wyliczenia. Aby umożliwić dostęp do kolekcji przez wiele wątków do odczytu i zapisu, należy zaimplementować własną synchronizację.

Zobacz też