Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++==
//
// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigXmlText.cs
- DataBindingValueUIHandler.cs
- DbModificationCommandTree.cs
- GridEntryCollection.cs
- IntSecurity.cs
- ProgressBar.cs
- DesignerView.Commands.cs
- XXXInfos.cs
- SafeThemeHandle.cs
- CalendarModeChangedEventArgs.cs
- SoapFormatter.cs
- TextFormatterHost.cs
- MobileUserControlDesigner.cs
- HostingEnvironmentSection.cs
- CounterSetInstanceCounterDataSet.cs
- InertiaExpansionBehavior.cs
- AdRotator.cs
- GridItemCollection.cs
- ProxySimple.cs
- AllMembershipCondition.cs
- FileIOPermission.cs
- XMLDiffLoader.cs
- ThreadAttributes.cs
- TextEditorLists.cs
- LocalizationParserHooks.cs
- ModelTreeEnumerator.cs
- FunctionUpdateCommand.cs
- BCryptSafeHandles.cs
- DeclaredTypeElement.cs
- PolyLineSegmentFigureLogic.cs
- DataGridViewCellFormattingEventArgs.cs
- CodeAttachEventStatement.cs
- COM2ColorConverter.cs
- DataControlField.cs
- HMACSHA1.cs
- FocusManager.cs
- FrugalMap.cs
- connectionpool.cs
- WinFormsSpinner.cs
- OracleBoolean.cs
- DetailsView.cs
- FieldDescriptor.cs
- SurrogateSelector.cs
- ListInitExpression.cs
- XPathNavigator.cs
- FileChangesMonitor.cs
- SqlCacheDependencySection.cs
- AtomParser.cs
- Page.cs
- SortableBindingList.cs
- SoapFaultCodes.cs
- InvalidAsynchronousStateException.cs
- JpegBitmapDecoder.cs
- PagerSettings.cs
- DictionaryTraceRecord.cs
- ModuleConfigurationInfo.cs
- FontWeightConverter.cs
- FontFaceLayoutInfo.cs
- PolyBezierSegment.cs
- RestHandlerFactory.cs
- MessageSmuggler.cs
- PropertyIDSet.cs
- DependencyObject.cs
- PeerResolver.cs
- EncoderNLS.cs
- TraceData.cs
- FeatureManager.cs
- EntityKey.cs
- DataContractSet.cs
- MatrixCamera.cs
- OutputCacheProfileCollection.cs
- NameValueConfigurationCollection.cs
- InvalidateEvent.cs
- ExplicitDiscriminatorMap.cs
- SettingsBase.cs
- Cursor.cs
- MissingManifestResourceException.cs
- EventPrivateKey.cs
- TickBar.cs
- SortQuery.cs
- XamlPointCollectionSerializer.cs
- SqlTriggerAttribute.cs
- WindowsSolidBrush.cs
- VariantWrapper.cs
- OleAutBinder.cs
- DocumentViewer.cs
- ErrorRuntimeConfig.cs
- VarInfo.cs
- StateRuntime.cs
- ShapeTypeface.cs
- EnumUnknown.cs
- TrackingRecord.cs
- ToolStripItem.cs
- ContainerAction.cs
- HandlerMappingMemo.cs
- ReturnEventArgs.cs
- NamespaceCollection.cs
- TreeNodeStyle.cs
- ChtmlTextWriter.cs
- Page.cs