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
- DetailsViewRowCollection.cs
- FtpWebResponse.cs
- XPathDocumentBuilder.cs
- ReadContentAsBinaryHelper.cs
- webbrowsersite.cs
- BamlBinaryWriter.cs
- OneOfElement.cs
- unitconverter.cs
- Vector3D.cs
- Atom10FormatterFactory.cs
- SplineQuaternionKeyFrame.cs
- HostProtectionPermission.cs
- DemultiplexingClientMessageFormatter.cs
- NameValueFileSectionHandler.cs
- RoleManagerModule.cs
- DataGridViewCheckBoxCell.cs
- AlternateViewCollection.cs
- ModelProperty.cs
- SqlRewriteScalarSubqueries.cs
- BufferBuilder.cs
- Internal.cs
- PersistStreamTypeWrapper.cs
- XmlStreamStore.cs
- DetailsViewPageEventArgs.cs
- XmlSchemaException.cs
- DataGridViewComboBoxCell.cs
- StackSpiller.cs
- DebugHandleTracker.cs
- UpdateExpressionVisitor.cs
- ProcessHostServerConfig.cs
- Deflater.cs
- StringFormat.cs
- LocalizedNameDescriptionPair.cs
- DependencyPropertyKind.cs
- FileDialogCustomPlacesCollection.cs
- VerificationException.cs
- DataObjectSettingDataEventArgs.cs
- ToolStripCollectionEditor.cs
- AsyncWaitHandle.cs
- TextUtf8RawTextWriter.cs
- ClrPerspective.cs
- ScriptBehaviorDescriptor.cs
- MostlySingletonList.cs
- RenderingBiasValidation.cs
- SafeNativeMethodsMilCoreApi.cs
- PartialList.cs
- XmlSiteMapProvider.cs
- LinkedDataMemberFieldEditor.cs
- AutomationIdentifierGuids.cs
- ConfigurationPropertyCollection.cs
- TemplateControl.cs
- BulletChrome.cs
- ScriptResourceAttribute.cs
- WaitHandle.cs
- FontStretchConverter.cs
- ContentValidator.cs
- XmlDictionary.cs
- XmlSchemaAttribute.cs
- dbdatarecord.cs
- WindowsListViewItemStartMenu.cs
- PathFigureCollectionValueSerializer.cs
- TableProviderWrapper.cs
- EntityContainerEmitter.cs
- GridViewRowEventArgs.cs
- URI.cs
- SQLDoubleStorage.cs
- TypeSchema.cs
- SelectionProcessor.cs
- WebPartVerb.cs
- AmbientEnvironment.cs
- MailWriter.cs
- TextDecorationCollection.cs
- WizardStepBase.cs
- ToolStripItemRenderEventArgs.cs
- SqlFunctionAttribute.cs
- KeyTimeConverter.cs
- LocalFileSettingsProvider.cs
- SiteOfOriginContainer.cs
- Label.cs
- PolyLineSegmentFigureLogic.cs
- MetadataArtifactLoader.cs
- ObjectListFieldCollection.cs
- PointKeyFrameCollection.cs
- VisualStateManager.cs
- RelationshipConstraintValidator.cs
- NetSectionGroup.cs
- StorageEndPropertyMapping.cs
- Icon.cs
- DataKey.cs
- CheckBoxList.cs
- AxHost.cs
- MachineKeyConverter.cs
- PersonalizableAttribute.cs
- WarningException.cs
- DbCommandTree.cs
- unsafenativemethodstextservices.cs
- ClosureBinding.cs
- ResourceBinder.cs
- TdsRecordBufferSetter.cs
- FilterQuery.cs