Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Common / QueryCache / QueryCacheKey.cs / 2 / QueryCacheKey.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//-----------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
{
using System;
using System.Collections.Generic;
using System.Text;
///
/// represents an abstract cache key
///
internal abstract class QueryCacheKey
{
#region Constants
protected const int EstimatedParameterStringSize = 20;
#endregion
#region Fields
///
/// entry hit counter
///
private uint _hitCount;
///
/// aging index
///
private int _agingIndex;
///
/// default string comparison kind - Ordinal
///
protected static StringComparison _stringComparison = StringComparison.Ordinal;
#endregion
#region Constructor
protected QueryCacheKey()
{
_hitCount = 1;
}
#endregion
#region Abstract Methods
///
/// Determines whether two instances of QueryCacheContext are equal.
/// Equality is value based.
///
///
///
public abstract override bool Equals( object obj );
///
/// Returns QueryCacheContext instance HashCode
///
///
public abstract override int GetHashCode();
#endregion
#region Internal API
///
/// Cache entry hit count
///
internal uint HitCount
{
get
{
return _hitCount;
}
set
{
_hitCount = value;
}
}
///
/// Gets/Sets Aging index for cache entry
///
internal int AgingIndex
{
get
{
return _agingIndex;
}
set
{
_agingIndex = value;
}
}
///
/// Updates hit count
///
internal void UpdateHit()
{
if (uint.MaxValue != _hitCount)
{
unchecked { _hitCount++; }
}
}
///
/// default string comparer
///
///
///
///
protected virtual bool Equals( string s, string t )
{
return String.Equals(s, t, _stringComparison);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//-----------------------------------------------------------------------------
namespace System.Data.Common.QueryCache
{
using System;
using System.Collections.Generic;
using System.Text;
///
/// represents an abstract cache key
///
internal abstract class QueryCacheKey
{
#region Constants
protected const int EstimatedParameterStringSize = 20;
#endregion
#region Fields
///
/// entry hit counter
///
private uint _hitCount;
///
/// aging index
///
private int _agingIndex;
///
/// default string comparison kind - Ordinal
///
protected static StringComparison _stringComparison = StringComparison.Ordinal;
#endregion
#region Constructor
protected QueryCacheKey()
{
_hitCount = 1;
}
#endregion
#region Abstract Methods
///
/// Determines whether two instances of QueryCacheContext are equal.
/// Equality is value based.
///
///
///
public abstract override bool Equals( object obj );
///
/// Returns QueryCacheContext instance HashCode
///
///
public abstract override int GetHashCode();
#endregion
#region Internal API
///
/// Cache entry hit count
///
internal uint HitCount
{
get
{
return _hitCount;
}
set
{
_hitCount = value;
}
}
///
/// Gets/Sets Aging index for cache entry
///
internal int AgingIndex
{
get
{
return _agingIndex;
}
set
{
_agingIndex = value;
}
}
///
/// Updates hit count
///
internal void UpdateHit()
{
if (uint.MaxValue != _hitCount)
{
unchecked { _hitCount++; }
}
}
///
/// default string comparer
///
///
///
///
protected virtual bool Equals( string s, string t )
{
return String.Equals(s, t, _stringComparison);
}
#endregion
}
}
// 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
- IChannel.cs
- DataGridPreparingCellForEditEventArgs.cs
- RightsManagementEncryptedStream.cs
- XamlReader.cs
- WSSecurityTokenSerializer.cs
- PasswordBoxAutomationPeer.cs
- IndexedEnumerable.cs
- SqlParameter.cs
- Console.cs
- Profiler.cs
- SqlProviderServices.cs
- CheckableControlBaseAdapter.cs
- KeyboardDevice.cs
- FunctionUpdateCommand.cs
- TableColumnCollection.cs
- TransactedBatchingElement.cs
- SendKeys.cs
- DTCTransactionManager.cs
- DBBindings.cs
- OdbcUtils.cs
- CodeExporter.cs
- DebuggerAttributes.cs
- FigureParaClient.cs
- WebExceptionStatus.cs
- TextEditorParagraphs.cs
- CodeIterationStatement.cs
- MaterializeFromAtom.cs
- ItemsPresenter.cs
- AttributeCollection.cs
- StylusCaptureWithinProperty.cs
- GeometryDrawing.cs
- RectAnimationBase.cs
- QuotedPrintableStream.cs
- ImportContext.cs
- DropDownList.cs
- ImpersonateTokenRef.cs
- Stylus.cs
- AttachedPropertyMethodSelector.cs
- ScriptReferenceEventArgs.cs
- PeerCollaborationPermission.cs
- MenuItemBindingCollection.cs
- SkipQueryOptionExpression.cs
- ArrayExtension.cs
- PointKeyFrameCollection.cs
- InstanceKeyCompleteException.cs
- PropertyValueUIItem.cs
- TypedServiceOperationListItem.cs
- OdbcDataReader.cs
- SQLResource.cs
- ParentQuery.cs
- Table.cs
- BindableAttribute.cs
- EnumConverter.cs
- SendMailErrorEventArgs.cs
- RenderCapability.cs
- SqlWriter.cs
- ListViewDataItem.cs
- PageParserFilter.cs
- RijndaelCryptoServiceProvider.cs
- ValueExpressions.cs
- TypeLoadException.cs
- DataGridRowAutomationPeer.cs
- _ConnectionGroup.cs
- SourceItem.cs
- XmlQueryStaticData.cs
- StaticDataManager.cs
- FixedTextContainer.cs
- SerializerDescriptor.cs
- HierarchicalDataBoundControl.cs
- AutomationFocusChangedEventArgs.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- RegularExpressionValidator.cs
- SchemaImporterExtension.cs
- CompilerScope.Storage.cs
- SymmetricSecurityProtocolFactory.cs
- HwndSource.cs
- RightsManagementProvider.cs
- SelectiveScrollingGrid.cs
- TraceInternal.cs
- PropertiesTab.cs
- ParserHooks.cs
- MetadataFile.cs
- CompModSwitches.cs
- ObjectViewListener.cs
- GridItemPattern.cs
- SmiMetaDataProperty.cs
- MatrixValueSerializer.cs
- SqlDependency.cs
- XamlWriter.cs
- StrokeCollectionDefaultValueFactory.cs
- DataGridViewToolTip.cs
- Command.cs
- dataSvcMapFileLoader.cs
- PropertyGeneratedEventArgs.cs
- DefaultPrintController.cs
- SequentialUshortCollection.cs
- EventLogPermissionAttribute.cs
- ToolBarPanel.cs
- DragDeltaEventArgs.cs
- DataGridViewHitTestInfo.cs