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
- CodeExpressionStatement.cs
- DetailsViewDeletedEventArgs.cs
- ServiceDescriptions.cs
- PointCollectionConverter.cs
- SerializableAttribute.cs
- TailCallAnalyzer.cs
- CodeTypeParameterCollection.cs
- DataFormats.cs
- ArraySegment.cs
- CommunicationObjectAbortedException.cs
- CompensatableTransactionScopeActivity.cs
- NamespaceDecl.cs
- TypeDescriptionProvider.cs
- EntityDataSourceState.cs
- NullRuntimeConfig.cs
- FixedFlowMap.cs
- NamespaceCollection.cs
- HttpCacheVaryByContentEncodings.cs
- CodeDefaultValueExpression.cs
- TagPrefixAttribute.cs
- DataError.cs
- EntitySetBase.cs
- WebConfigurationHost.cs
- LineSegment.cs
- MenuItem.cs
- XmlSchemaAttributeGroup.cs
- ClientBuildManagerCallback.cs
- MenuItemStyleCollection.cs
- ListViewItem.cs
- AsymmetricSignatureDeformatter.cs
- StringResourceManager.cs
- Script.cs
- Identifier.cs
- PeerNameRegistration.cs
- DeploymentSection.cs
- TypeViewSchema.cs
- DataGridViewCellConverter.cs
- BatchWriter.cs
- AuthenticationService.cs
- ShaderEffect.cs
- ErrorHandler.cs
- XPathPatternParser.cs
- HttpResponseBase.cs
- AuthenticationSection.cs
- CompositeDataBoundControl.cs
- WebContentFormatHelper.cs
- EncryptedPackage.cs
- WorkflowPageSetupDialog.cs
- UnmanagedMemoryAccessor.cs
- PersonalizationProviderHelper.cs
- DataSourceControlBuilder.cs
- CreateUserWizard.cs
- TripleDESCryptoServiceProvider.cs
- StructuralType.cs
- ColorComboBox.cs
- ViewBase.cs
- ExtendedPropertyDescriptor.cs
- ExpressionParser.cs
- LogFlushAsyncResult.cs
- CqlQuery.cs
- TableSectionStyle.cs
- EmptyImpersonationContext.cs
- PrintDialog.cs
- _HeaderInfo.cs
- BoolExpression.cs
- SystemException.cs
- HtmlObjectListAdapter.cs
- SmiGettersStream.cs
- ArgIterator.cs
- DurableDispatcherAddressingFault.cs
- SqlNodeAnnotation.cs
- ButtonBaseAutomationPeer.cs
- SelectionChangedEventArgs.cs
- XamlTreeBuilder.cs
- SurrogateEncoder.cs
- ListSourceHelper.cs
- exports.cs
- BehaviorDragDropEventArgs.cs
- XmlElementCollection.cs
- LayoutUtils.cs
- MetadataPropertyvalue.cs
- VoiceSynthesis.cs
- OleDbConnectionInternal.cs
- ManipulationLogic.cs
- nulltextnavigator.cs
- OdbcDataAdapter.cs
- XComponentModel.cs
- BaseAppDomainProtocolHandler.cs
- ObjectDataSource.cs
- QilName.cs
- InputGestureCollection.cs
- ControlPaint.cs
- SerializationEventsCache.cs
- OrderByQueryOptionExpression.cs
- SubMenuStyleCollection.cs
- DesignerSerializationOptionsAttribute.cs
- DataGridItemEventArgs.cs
- OleTxTransactionInfo.cs
- TreeBuilderXamlTranslator.cs
- DoubleIndependentAnimationStorage.cs