134 lines
4.8 KiB
C#
134 lines
4.8 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Collections.Generic
|
|
{
|
|
/// <summary>Represents a node in a <see cref="T:System.Collections.Generic.LinkedList`1" />. This class cannot be inherited.</summary>
|
|
/// <typeparam name="T">Specifies the element type of the linked list.</typeparam>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x0200000D RID: 13
|
|
[ComVisible(false)]
|
|
public sealed class LinkedListNode<T>
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> class, containing the specified value.</summary>
|
|
/// <param name="value">The value to contain in the <see cref="T:System.Collections.Generic.LinkedListNode`1" />.</param>
|
|
// Token: 0x06000038 RID: 56 RVA: 0x00002B28 File Offset: 0x00000D28
|
|
public LinkedListNode(T value)
|
|
{
|
|
this.item = value;
|
|
}
|
|
|
|
// Token: 0x06000039 RID: 57 RVA: 0x00002B38 File Offset: 0x00000D38
|
|
internal LinkedListNode(LinkedList<T> list, T value)
|
|
{
|
|
this.container = list;
|
|
this.item = value;
|
|
this.forward = this;
|
|
this.back = this;
|
|
}
|
|
|
|
// Token: 0x0600003A RID: 58 RVA: 0x00002B6C File Offset: 0x00000D6C
|
|
internal LinkedListNode(LinkedList<T> list, T value, LinkedListNode<T> previousNode, LinkedListNode<T> nextNode)
|
|
{
|
|
this.container = list;
|
|
this.item = value;
|
|
this.back = previousNode;
|
|
this.forward = nextNode;
|
|
previousNode.forward = this;
|
|
nextNode.back = this;
|
|
}
|
|
|
|
// Token: 0x0600003B RID: 59 RVA: 0x00002BAC File Offset: 0x00000DAC
|
|
internal void Detach()
|
|
{
|
|
this.back.forward = this.forward;
|
|
this.forward.back = this.back;
|
|
this.forward = (this.back = null);
|
|
this.container = null;
|
|
}
|
|
|
|
// Token: 0x0600003C RID: 60 RVA: 0x00002BF4 File Offset: 0x00000DF4
|
|
internal void SelfReference(LinkedList<T> list)
|
|
{
|
|
this.forward = this;
|
|
this.back = this;
|
|
this.container = list;
|
|
}
|
|
|
|
// Token: 0x0600003D RID: 61 RVA: 0x00002C0C File Offset: 0x00000E0C
|
|
internal void InsertBetween(LinkedListNode<T> previousNode, LinkedListNode<T> nextNode, LinkedList<T> list)
|
|
{
|
|
previousNode.forward = this;
|
|
nextNode.back = this;
|
|
this.forward = nextNode;
|
|
this.back = previousNode;
|
|
this.container = list;
|
|
}
|
|
|
|
/// <summary>Gets the <see cref="T:System.Collections.Generic.LinkedList`1" /> that the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> belongs to.</summary>
|
|
/// <returns>A reference to the <see cref="T:System.Collections.Generic.LinkedList`1" /> that the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> belongs to, or null if the <see cref="T:System.Collections.Generic.LinkedListNode`1" /> is not linked.</returns>
|
|
// Token: 0x1700000C RID: 12
|
|
// (get) Token: 0x0600003E RID: 62 RVA: 0x00002C34 File Offset: 0x00000E34
|
|
public LinkedList<T> List
|
|
{
|
|
get
|
|
{
|
|
return this.container;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the next node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
|
|
/// <returns>A reference to the next node in the <see cref="T:System.Collections.Generic.LinkedList`1" />, or null if the current node is the last element (<see cref="P:System.Collections.Generic.LinkedList`1.Last" />) of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
|
|
// Token: 0x1700000D RID: 13
|
|
// (get) Token: 0x0600003F RID: 63 RVA: 0x00002C3C File Offset: 0x00000E3C
|
|
public LinkedListNode<T> Next
|
|
{
|
|
get
|
|
{
|
|
return (this.container == null || this.forward == this.container.first) ? null : this.forward;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the previous node in the <see cref="T:System.Collections.Generic.LinkedList`1" />.</summary>
|
|
/// <returns>A reference to the previous node in the <see cref="T:System.Collections.Generic.LinkedList`1" />, or null if the current node is the first element (<see cref="P:System.Collections.Generic.LinkedList`1.First" />) of the <see cref="T:System.Collections.Generic.LinkedList`1" />.</returns>
|
|
// Token: 0x1700000E RID: 14
|
|
// (get) Token: 0x06000040 RID: 64 RVA: 0x00002C6C File Offset: 0x00000E6C
|
|
public LinkedListNode<T> Previous
|
|
{
|
|
get
|
|
{
|
|
return (this.container == null || this == this.container.first) ? null : this.back;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the value contained in the node.</summary>
|
|
/// <returns>The value contained in the node.</returns>
|
|
// Token: 0x1700000F RID: 15
|
|
// (get) Token: 0x06000041 RID: 65 RVA: 0x00002CA4 File Offset: 0x00000EA4
|
|
// (set) Token: 0x06000042 RID: 66 RVA: 0x00002CAC File Offset: 0x00000EAC
|
|
public T Value
|
|
{
|
|
get
|
|
{
|
|
return this.item;
|
|
}
|
|
set
|
|
{
|
|
this.item = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0400002F RID: 47
|
|
private T item;
|
|
|
|
// Token: 0x04000030 RID: 48
|
|
private LinkedList<T> container;
|
|
|
|
// Token: 0x04000031 RID: 49
|
|
internal LinkedListNode<T> forward;
|
|
|
|
// Token: 0x04000032 RID: 50
|
|
internal LinkedListNode<T> back;
|
|
}
|
|
}
|