Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Collections / Generic / KeyValuePair.cs / 1 / KeyValuePair.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** Interface: KeyValuePair
**
**
** Purpose: Generic key-value pair for dictionary enumerators.
**
**
===========================================================*/
namespace System.Collections.Generic {
using System;
using System.Text;
// A KeyValuePair holds a key and a value from a dictionary.
// It is returned by IDictionaryEnumerator::GetEntry().
[Serializable()]
public struct KeyValuePair {
private TKey key;
private TValue value;
public KeyValuePair(TKey key, TValue value) {
this.key = key;
this.value = value;
}
public TKey Key {
get { return key; }
}
public TValue Value {
get { return value; }
}
public override string ToString() {
StringBuilder s = new StringBuilder();
s.Append('[');
if( Key != null) {
s.Append(Key.ToString());
}
s.Append(", ");
if( Value != null) {
s.Append(Value.ToString());
}
s.Append(']');
return s.ToString();
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CLRBindingWorker.cs
- ProjectionCamera.cs
- EventEntry.cs
- RepeaterItemCollection.cs
- ServiceNotStartedException.cs
- DBConcurrencyException.cs
- HwndKeyboardInputProvider.cs
- XpsSerializationException.cs
- GPRECTF.cs
- CodeDOMProvider.cs
- PopupRoot.cs
- RequestBringIntoViewEventArgs.cs
- IISMapPath.cs
- GPStream.cs
- ResolveResponse.cs
- DesignerOptionService.cs
- EditCommandColumn.cs
- DtcInterfaces.cs
- ResetableIterator.cs
- MemberInitExpression.cs
- CodeExporter.cs
- PersonalizationProviderHelper.cs
- DataObjectCopyingEventArgs.cs
- webproxy.cs
- ByteConverter.cs
- MDIClient.cs
- StructuralObject.cs
- AttachedPropertyMethodSelector.cs
- ObjectDataSourceView.cs
- OleDbParameter.cs
- ContentOnlyMessage.cs
- NewArrayExpression.cs
- XXXInfos.cs
- clipboard.cs
- CommonDialog.cs
- SoundPlayer.cs
- PassportPrincipal.cs
- TimeEnumHelper.cs
- GroupBox.cs
- SvcMapFileLoader.cs
- DynamicAttribute.cs
- ContextQuery.cs
- Visitor.cs
- CustomAssemblyResolver.cs
- UriSectionData.cs
- StringComparer.cs
- Regex.cs
- Timer.cs
- KeyManager.cs
- CopyOnWriteList.cs
- TextSchema.cs
- GridViewColumnHeaderAutomationPeer.cs
- WindowInteropHelper.cs
- _ScatterGatherBuffers.cs
- DateTimeOffsetStorage.cs
- XPathMessageContext.cs
- CodeDirectionExpression.cs
- LookupBindingPropertiesAttribute.cs
- View.cs
- EntityEntry.cs
- ToolTipAutomationPeer.cs
- XmlSigningNodeWriter.cs
- TagElement.cs
- AppDomainFactory.cs
- ComEventsMethod.cs
- MimeBasePart.cs
- CultureTableRecord.cs
- CqlParserHelpers.cs
- SaveFileDialog.cs
- Mutex.cs
- OleDbParameter.cs
- ParameterRefs.cs
- AbandonedMutexException.cs
- DataGridViewCellEventArgs.cs
- MediaContext.cs
- WebPartConnectionsDisconnectVerb.cs
- TextSerializer.cs
- RequestCachingSection.cs
- ReplacementText.cs
- InfoCardX509Validator.cs
- HttpDictionary.cs
- SafeEventLogWriteHandle.cs
- AuthenticatingEventArgs.cs
- Menu.cs
- Int32Storage.cs
- Timer.cs
- DefaultValueAttribute.cs
- ViewKeyConstraint.cs
- PageClientProxyGenerator.cs
- JoinElimination.cs
- ScrollItemProviderWrapper.cs
- SourceItem.cs
- HelpHtmlBuilder.cs
- TTSEvent.cs
- RadioButton.cs
- StringDictionaryWithComparer.cs
- ReflectionTypeLoadException.cs
- Rotation3DAnimationBase.cs
- HandleExceptionArgs.cs
- WebPartVerb.cs