Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Collections / Generic / KeyValuePair.cs / 2 / 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();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InvokeMemberBinder.cs
- DataSourceProvider.cs
- MemoryRecordBuffer.cs
- CacheHelper.cs
- BuildResult.cs
- UnsafeNativeMethods.cs
- PropertyGridCommands.cs
- DynamicUpdateCommand.cs
- WebPartChrome.cs
- EntityDataSourceQueryBuilder.cs
- SplashScreen.cs
- KeyedHashAlgorithm.cs
- DataGridViewCellPaintingEventArgs.cs
- WorkflowOperationFault.cs
- TextTreeText.cs
- WebPartZoneAutoFormat.cs
- SelectionBorderGlyph.cs
- COAUTHINFO.cs
- ScaleTransform3D.cs
- AdRotator.cs
- ConfigXmlText.cs
- MetaData.cs
- ListItemDetailViewAttribute.cs
- CryptoApi.cs
- BamlWriter.cs
- ellipse.cs
- ServiceOperationUIEditor.cs
- ConstraintCollection.cs
- Expression.cs
- SpellCheck.cs
- NodeInfo.cs
- LocalServiceSecuritySettings.cs
- ResizeGrip.cs
- XmlSchemaAttribute.cs
- SerializationSectionGroup.cs
- securitycriticaldataformultiplegetandset.cs
- ResourceAssociationType.cs
- DiagnosticsConfiguration.cs
- BitmapEffectInputConnector.cs
- SafeFileMappingHandle.cs
- ControlCachePolicy.cs
- Operand.cs
- RefreshEventArgs.cs
- FileDialogCustomPlacesCollection.cs
- SQLConvert.cs
- OpCellTreeNode.cs
- NameValueFileSectionHandler.cs
- PropertyInfo.cs
- DesignTimeDataBinding.cs
- CompilationRelaxations.cs
- VirtualDirectoryMapping.cs
- ApplicationCommands.cs
- complextypematerializer.cs
- Adorner.cs
- InheritablePropertyChangeInfo.cs
- FlowNode.cs
- AssemblyAttributesGoHere.cs
- XmlSchemaSet.cs
- CodeDomSerializer.cs
- DataGridViewCell.cs
- Viewport2DVisual3D.cs
- PointCollection.cs
- ColorContext.cs
- RelationshipEndMember.cs
- ExtentJoinTreeNode.cs
- Vars.cs
- ListItemViewAttribute.cs
- ServerIdentity.cs
- Baml2006ReaderFrame.cs
- ColumnCollection.cs
- DigitalSignature.cs
- SortDescription.cs
- VisualBasicHelper.cs
- RectangleConverter.cs
- SchemaLookupTable.cs
- ToggleProviderWrapper.cs
- _DisconnectOverlappedAsyncResult.cs
- WorkflowTransactionService.cs
- NonParentingControl.cs
- DataGridViewTopLeftHeaderCell.cs
- CompModSwitches.cs
- ThreadExceptionDialog.cs
- sitestring.cs
- ImmComposition.cs
- WebHttpBindingCollectionElement.cs
- DashStyle.cs
- RowVisual.cs
- CssClassPropertyAttribute.cs
- TextFormatter.cs
- SiteMapProvider.cs
- XmlCustomFormatter.cs
- DataGridViewLayoutData.cs
- BitmapPalettes.cs
- Policy.cs
- SemanticResultValue.cs
- DelegateArgumentValue.cs
- UriSection.cs
- ElementAction.cs
- WizardSideBarListControlItemEventArgs.cs
- MembershipSection.cs