102 lines
3.0 KiB
C#
102 lines
3.0 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace System.Collections.Generic
|
|
{
|
|
/// <summary>Defines a key/value pair that can be set or retrieved.</summary>
|
|
/// <typeparam name="TKey">The type of the key.</typeparam>
|
|
/// <typeparam name="TValue">The type of the value.</typeparam>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x0200010D RID: 269
|
|
[DebuggerDisplay("{value}", Name = "[{key}]")]
|
|
[Serializable]
|
|
public struct KeyValuePair<TKey, TValue>
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.KeyValuePair`2" /> structure with the specified key and value.</summary>
|
|
/// <param name="key">The object defined in each key/value pair.</param>
|
|
/// <param name="value">The definition associated with <paramref name="key" />.</param>
|
|
// Token: 0x06000D03 RID: 3331 RVA: 0x00039E8C File Offset: 0x0003808C
|
|
public KeyValuePair(TKey key, TValue value)
|
|
{
|
|
this.Key = key;
|
|
this.Value = value;
|
|
}
|
|
|
|
/// <summary>Gets the key in the key/value pair.</summary>
|
|
/// <returns>A <paramref name="TKey" /> that is the key of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />. </returns>
|
|
// Token: 0x170001F2 RID: 498
|
|
// (get) Token: 0x06000D04 RID: 3332 RVA: 0x00039E9C File Offset: 0x0003809C
|
|
// (set) Token: 0x06000D05 RID: 3333 RVA: 0x00039EA4 File Offset: 0x000380A4
|
|
public TKey Key
|
|
{
|
|
get
|
|
{
|
|
return this.key;
|
|
}
|
|
private set
|
|
{
|
|
this.key = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the value in the key/value pair.</summary>
|
|
/// <returns>A <paramref name="TValue" /> that is the value of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />. </returns>
|
|
// Token: 0x170001F3 RID: 499
|
|
// (get) Token: 0x06000D06 RID: 3334 RVA: 0x00039EB0 File Offset: 0x000380B0
|
|
// (set) Token: 0x06000D07 RID: 3335 RVA: 0x00039EB8 File Offset: 0x000380B8
|
|
public TValue Value
|
|
{
|
|
get
|
|
{
|
|
return this.value;
|
|
}
|
|
private set
|
|
{
|
|
this.value = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>Returns a string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />, using the string representations of the key and value.</summary>
|
|
/// <returns>A string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" />, which includes the string representations of the key and value.</returns>
|
|
// Token: 0x06000D08 RID: 3336 RVA: 0x00039EC4 File Offset: 0x000380C4
|
|
public override string ToString()
|
|
{
|
|
string[] array = new string[5];
|
|
array[0] = "[";
|
|
int num = 1;
|
|
string text;
|
|
if (this.Key != null)
|
|
{
|
|
TKey tkey = this.Key;
|
|
text = tkey.ToString();
|
|
}
|
|
else
|
|
{
|
|
text = string.Empty;
|
|
}
|
|
array[num] = text;
|
|
array[2] = ", ";
|
|
int num2 = 3;
|
|
string text2;
|
|
if (this.Value != null)
|
|
{
|
|
TValue tvalue = this.Value;
|
|
text2 = tvalue.ToString();
|
|
}
|
|
else
|
|
{
|
|
text2 = string.Empty;
|
|
}
|
|
array[num2] = text2;
|
|
array[4] = "]";
|
|
return string.Concat(array);
|
|
}
|
|
|
|
// Token: 0x0400037C RID: 892
|
|
private TKey key;
|
|
|
|
// Token: 0x0400037D RID: 893
|
|
private TValue value;
|
|
}
|
|
}
|