Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / Generic / KeyValuePair.cs / 1305376 / 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
- ScrollableControl.cs
- RSAPKCS1KeyExchangeFormatter.cs
- CombinedGeometry.cs
- WebPartConnectionsConnectVerb.cs
- DocumentReference.cs
- LinkedList.cs
- KeyGestureValueSerializer.cs
- ZipIOLocalFileDataDescriptor.cs
- FormViewRow.cs
- FastPropertyAccessor.cs
- TextElementCollection.cs
- ObjectTag.cs
- ModelServiceImpl.cs
- COM2FontConverter.cs
- Policy.cs
- ApplicationException.cs
- FeatureManager.cs
- BrowserCapabilitiesCompiler.cs
- MissingMemberException.cs
- JulianCalendar.cs
- Boolean.cs
- Matrix3DStack.cs
- FrameworkElementAutomationPeer.cs
- RunClient.cs
- SiteMapDataSource.cs
- FunctionDetailsReader.cs
- WebPart.cs
- ToolboxItemCollection.cs
- WebPartZone.cs
- FreezableDefaultValueFactory.cs
- RelationshipManager.cs
- HttpHostedTransportConfiguration.cs
- CompositeControlDesigner.cs
- SimpleTextLine.cs
- HWStack.cs
- FileSystemEventArgs.cs
- WindowsListViewSubItem.cs
- CustomAttribute.cs
- Trace.cs
- ConfigurationLocation.cs
- SqlNodeAnnotation.cs
- translator.cs
- AnimatedTypeHelpers.cs
- BoundPropertyEntry.cs
- HttpServerVarsCollection.cs
- AutoResizedEvent.cs
- ThreadExceptionEvent.cs
- AuthenticationSection.cs
- OperationAbortedException.cs
- SuppressIldasmAttribute.cs
- ObjectViewEntityCollectionData.cs
- SamlSubject.cs
- ErrorTableItemStyle.cs
- StorageScalarPropertyMapping.cs
- CornerRadius.cs
- SendDesigner.xaml.cs
- AxisAngleRotation3D.cs
- DaylightTime.cs
- SqlInternalConnectionTds.cs
- InstanceStoreQueryResult.cs
- XmlQueryType.cs
- PrimitiveXmlSerializers.cs
- Constants.cs
- compensatingcollection.cs
- HtmlTableCellCollection.cs
- HttpResponse.cs
- AttributeTable.cs
- XmlCollation.cs
- OleDbTransaction.cs
- WindowsTooltip.cs
- SafeNativeMethods.cs
- GestureRecognizer.cs
- XmlSchemaSequence.cs
- ServicePointManagerElement.cs
- BinaryFormatter.cs
- TemplateField.cs
- Console.cs
- GenericArgumentsUpdater.cs
- XmlNodeChangedEventArgs.cs
- WeakReadOnlyCollection.cs
- Matrix3DValueSerializer.cs
- XmlSignificantWhitespace.cs
- XDeferredAxisSource.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- TypeConverterAttribute.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- CodeTypeReferenceExpression.cs
- HostVisual.cs
- SQLSingleStorage.cs
- Utils.cs
- CreateUserWizardStep.cs
- UriScheme.cs
- SchemaCollectionCompiler.cs
- InvalidChannelBindingException.cs
- PropertyChangedEventManager.cs
- WindowInteractionStateTracker.cs
- WFItemsToSpacerVisibility.cs
- DateTimeConverter2.cs
- DataRelationCollection.cs
- TextAnchor.cs