Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / QueryCache / QueryCacheKey.cs / 1 / 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
- Scanner.cs
- DayRenderEvent.cs
- StylusPlugInCollection.cs
- AnimatedTypeHelpers.cs
- AsyncOperationManager.cs
- BitmapFrameEncode.cs
- AxisAngleRotation3D.cs
- NameValueSectionHandler.cs
- GeometryHitTestResult.cs
- EntityViewGenerationConstants.cs
- AccessViolationException.cs
- NumericPagerField.cs
- SQLBoolean.cs
- ServicePointManager.cs
- Symbol.cs
- SystemUdpStatistics.cs
- WindowsGraphicsWrapper.cs
- GridProviderWrapper.cs
- MultiPartWriter.cs
- CodeMemberMethod.cs
- DateTimeOffset.cs
- SqlDependencyListener.cs
- FlagsAttribute.cs
- OdbcUtils.cs
- SqlWebEventProvider.cs
- AssociationSetMetadata.cs
- DecimalAnimation.cs
- FlowDocument.cs
- WebCategoryAttribute.cs
- XmlWhitespace.cs
- sortedlist.cs
- DoubleLink.cs
- TemplateBuilder.cs
- DataListItemEventArgs.cs
- TableAutomationPeer.cs
- StylusPointDescription.cs
- LinkConverter.cs
- SolidColorBrush.cs
- Win32MouseDevice.cs
- EdmSchemaAttribute.cs
- WebScriptServiceHost.cs
- PropertyInformationCollection.cs
- LoginView.cs
- SqlAliasesReferenced.cs
- ItemsControl.cs
- TraceLevelStore.cs
- SR.cs
- IMembershipProvider.cs
- HandleRef.cs
- FixedElement.cs
- FunctionOverloadResolver.cs
- WebPartExportVerb.cs
- SoapSchemaExporter.cs
- TypeFieldSchema.cs
- StylusPointPropertyUnit.cs
- NotifyCollectionChangedEventArgs.cs
- TimersDescriptionAttribute.cs
- base64Transforms.cs
- UInt64Storage.cs
- XmlEncoding.cs
- ToolboxItemCollection.cs
- Light.cs
- LocatorGroup.cs
- XmlStreamNodeWriter.cs
- NegotiationTokenProvider.cs
- LineUtil.cs
- RectangleConverter.cs
- EventsTab.cs
- WpfPayload.cs
- XmlSchemaSequence.cs
- DynamicResourceExtensionConverter.cs
- UidManager.cs
- RelationshipNavigation.cs
- ProfilePropertyNameValidator.cs
- PageBorderless.cs
- SpecialFolderEnumConverter.cs
- ObjectDataSourceEventArgs.cs
- SoundPlayerAction.cs
- XmlArrayAttribute.cs
- WinFormsUtils.cs
- XmlSchemaSet.cs
- ResourcePart.cs
- AppSettingsExpressionBuilder.cs
- FloatAverageAggregationOperator.cs
- EventMappingSettings.cs
- FileDialog.cs
- TypeUtil.cs
- CreateUserErrorEventArgs.cs
- ItemList.cs
- WebDisplayNameAttribute.cs
- RSAPKCS1SignatureDeformatter.cs
- ConstNode.cs
- ListInitExpression.cs
- Hyperlink.cs
- SessionState.cs
- ListDictionaryInternal.cs
- SqlCharStream.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- GatewayDefinition.cs
- ACL.cs