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
- BrowserCapabilitiesCodeGenerator.cs
- RuleAction.cs
- RenderingEventArgs.cs
- XmlSchemaExternal.cs
- SimpleWebHandlerParser.cs
- UserControlBuildProvider.cs
- MetadataPropertyCollection.cs
- Scene3D.cs
- DataListItemEventArgs.cs
- DataGridTable.cs
- HttpRequestBase.cs
- ConfigurationStrings.cs
- CodeRegionDirective.cs
- ServicePoint.cs
- OverflowException.cs
- TabItem.cs
- CompiledIdentityConstraint.cs
- DesignerAttribute.cs
- DialogResultConverter.cs
- UserPreferenceChangedEventArgs.cs
- CompModSwitches.cs
- SHA512CryptoServiceProvider.cs
- WindowInteropHelper.cs
- WebService.cs
- KeyConstraint.cs
- ContainerVisual.cs
- Int64Animation.cs
- SHA384.cs
- ZoneIdentityPermission.cs
- OdbcEnvironmentHandle.cs
- ExpanderAutomationPeer.cs
- XmlCharCheckingWriter.cs
- FontStretches.cs
- ProcessInfo.cs
- ProfilePropertySettingsCollection.cs
- FileDialog_Vista_Interop.cs
- WebPartMenuStyle.cs
- StylusPointPropertyId.cs
- SpecialFolderEnumConverter.cs
- TableLayoutStyleCollection.cs
- BrowserCapabilitiesFactory.cs
- BrowsableAttribute.cs
- Literal.cs
- ControlFilterExpression.cs
- WindowsToolbarAsMenu.cs
- ErrorEventArgs.cs
- ACE.cs
- CompositeActivityValidator.cs
- indexingfiltermarshaler.cs
- Profiler.cs
- GeometryDrawing.cs
- ClientRuntimeConfig.cs
- SupportingTokenBindingElement.cs
- ContentElementAutomationPeer.cs
- ValidationResult.cs
- XmlWrappingWriter.cs
- ToolTipAutomationPeer.cs
- Calendar.cs
- Wildcard.cs
- CombinedTcpChannel.cs
- DataListItemCollection.cs
- ConfigurationStrings.cs
- RoleGroupCollectionEditor.cs
- HijriCalendar.cs
- SystemTcpStatistics.cs
- UnsafeNativeMethodsPenimc.cs
- templategroup.cs
- DataGridRowEventArgs.cs
- UserControlCodeDomTreeGenerator.cs
- SchemaElementLookUpTable.cs
- FormViewDeleteEventArgs.cs
- ConfigurationManager.cs
- CompositionTarget.cs
- QueryConverter.cs
- DataGridItem.cs
- BamlLocalizer.cs
- BaseCodePageEncoding.cs
- BufferedStream.cs
- LineProperties.cs
- GCHandleCookieTable.cs
- GregorianCalendarHelper.cs
- ApplicationSecurityManager.cs
- BaseConfigurationRecord.cs
- GenericXmlSecurityToken.cs
- ComponentFactoryHelpers.cs
- _HeaderInfo.cs
- MLangCodePageEncoding.cs
- WebContentFormatHelper.cs
- WebCategoryAttribute.cs
- SQLCharsStorage.cs
- RoutedEventConverter.cs
- EntityDataSourceValidationException.cs
- ReferentialConstraint.cs
- MeasureData.cs
- ControlParameter.cs
- Debug.cs
- SimpleHandlerBuildProvider.cs
- TabRenderer.cs
- Point.cs
- MetadataStore.cs