mscorlib(4.0.0.0) API with additions
KeyValuePair.cs
1 using System.Text;
2 
4 {
9  [__DynamicallyInvokable]
10  public struct KeyValuePair<TKey, TValue>
11  {
12  private TKey key;
13 
14  private TValue value;
15 
18  [__DynamicallyInvokable]
19  public TKey Key
20  {
21  [__DynamicallyInvokable]
22  get
23  {
24  return key;
25  }
26  }
27 
30  [__DynamicallyInvokable]
31  public TValue Value
32  {
33  [__DynamicallyInvokable]
34  get
35  {
36  return value;
37  }
38  }
39 
43  [__DynamicallyInvokable]
44  public KeyValuePair(TKey key, TValue value)
45  {
46  this.key = key;
47  this.value = value;
48  }
49 
52  [__DynamicallyInvokable]
53  public override string ToString()
54  {
55  StringBuilder stringBuilder = StringBuilderCache.Acquire();
56  stringBuilder.Append('[');
57  if (Key != null)
58  {
59  stringBuilder.Append(Key.ToString());
60  }
61  stringBuilder.Append(", ");
62  if (Value != null)
63  {
64  stringBuilder.Append(Value.ToString());
65  }
66  stringBuilder.Append(']');
67  return StringBuilderCache.GetStringAndRelease(stringBuilder);
68  }
69  }
70 }
TValue Value
Gets the value in the key/value pair.
Definition: KeyValuePair.cs:32
Definition: __Canon.cs:3
Defines a key/value pair that can be set or retrieved.
Definition: KeyValuePair.cs:10
TKey Key
Gets the key in the key/value pair.
Definition: KeyValuePair.cs:20
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
KeyValuePair(TKey key, TValue value)
Initializes a new instance of the T:System.Collections.Generic.KeyValuePair`2 structure with the spec...
Definition: KeyValuePair.cs:44
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
Specifies that the class can be serialized.
override string ToString()
Returns a string representation of the T:System.Collections.Generic.KeyValuePair`2,...
Definition: KeyValuePair.cs:53