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
- ErrorActivity.cs
- ToolStripGripRenderEventArgs.cs
- CopyAction.cs
- Bitmap.cs
- StringComparer.cs
- XmlSchemaSimpleTypeUnion.cs
- GridItemPattern.cs
- PieceDirectory.cs
- UrlMappingsModule.cs
- CodeAttachEventStatement.cs
- AssemblyBuilder.cs
- DocumentGrid.cs
- XamlVector3DCollectionSerializer.cs
- CheckBoxPopupAdapter.cs
- XamlPathDataSerializer.cs
- TraceSection.cs
- RegexNode.cs
- AtomServiceDocumentSerializer.cs
- FactoryRecord.cs
- QueryAccessibilityHelpEvent.cs
- Profiler.cs
- TCPClient.cs
- sqlser.cs
- Component.cs
- ErrorStyle.cs
- BooleanSwitch.cs
- SmuggledIUnknown.cs
- Ops.cs
- PopupRootAutomationPeer.cs
- InvokePatternIdentifiers.cs
- DoubleLinkListEnumerator.cs
- PropertyInfo.cs
- HttpRequest.cs
- WSMessageEncoding.cs
- StateFinalizationActivity.cs
- DtdParser.cs
- sqlser.cs
- RSAOAEPKeyExchangeFormatter.cs
- RSAPKCS1SignatureFormatter.cs
- EqualityComparer.cs
- ExpandCollapseProviderWrapper.cs
- StyleTypedPropertyAttribute.cs
- Application.cs
- Array.cs
- DataContractSet.cs
- SafeNativeMethods.cs
- Sequence.cs
- UnsafeNativeMethods.cs
- ScriptingRoleServiceSection.cs
- listitem.cs
- ResourceWriter.cs
- AuthenticationModuleElementCollection.cs
- DataGridViewTextBoxColumn.cs
- GroupQuery.cs
- TreeViewImageKeyConverter.cs
- CompilerErrorCollection.cs
- BitmapDownload.cs
- DbConnectionStringBuilder.cs
- SurrogateEncoder.cs
- _DisconnectOverlappedAsyncResult.cs
- ObjectTypeMapping.cs
- AppearanceEditorPart.cs
- WebBrowserContainer.cs
- PermissionSetTriple.cs
- Vector3DValueSerializer.cs
- SerializationInfo.cs
- TimeZone.cs
- SerializationHelper.cs
- Utils.cs
- DocumentViewerBase.cs
- GridViewUpdateEventArgs.cs
- DataPagerCommandEventArgs.cs
- PrintPageEvent.cs
- DoubleConverter.cs
- EventLogLink.cs
- PathGradientBrush.cs
- BitmapFrame.cs
- DataSysAttribute.cs
- BinaryConverter.cs
- RelationshipConstraintValidator.cs
- AuthStoreRoleProvider.cs
- TreeNodeClickEventArgs.cs
- ListViewInsertionMark.cs
- OTFRasterizer.cs
- SafeHandle.cs
- TypeBrowserDialog.cs
- ErrorStyle.cs
- MtomMessageEncoder.cs
- HostedImpersonationContext.cs
- EditorPartCollection.cs
- DateBoldEvent.cs
- CompilationSection.cs
- HttpDictionary.cs
- TypeUtil.cs
- CipherData.cs
- DictionarySectionHandler.cs
- XamlContextStack.cs
- XmlIterators.cs
- DataTableCollection.cs
- RequestQueue.cs