Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / QueryCache / QueryCacheKey.cs / 1305376 / QueryCacheKey.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //----------------------------------------------------------------------------- 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 [....] // @backupOwner [....] //----------------------------------------------------------------------------- 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
- SystemNetHelpers.cs
- CapabilitiesAssignment.cs
- AppDomain.cs
- DataSvcMapFile.cs
- MouseWheelEventArgs.cs
- DataGridViewCellConverter.cs
- StrokeFIndices.cs
- MultiSelector.cs
- ReflectionTypeLoadException.cs
- DataPagerFieldCommandEventArgs.cs
- XmlSchemaSubstitutionGroup.cs
- FormatStringEditor.cs
- SrgsElementFactoryCompiler.cs
- StreamingContext.cs
- SoundPlayer.cs
- ToolStripItemGlyph.cs
- OdbcDataReader.cs
- DataRecord.cs
- TraversalRequest.cs
- TemplateField.cs
- RegistrySecurity.cs
- ScriptMethodAttribute.cs
- ConstantCheck.cs
- HttpRuntime.cs
- Listener.cs
- HtmlControlAdapter.cs
- TcpProcessProtocolHandler.cs
- Select.cs
- SelectionUIService.cs
- EventLogEntryCollection.cs
- BitmapPalette.cs
- CodeDefaultValueExpression.cs
- ReflectionUtil.cs
- AppSettingsReader.cs
- PathFigure.cs
- PassportAuthenticationModule.cs
- CodeDelegateInvokeExpression.cs
- MatrixUtil.cs
- SecurityAlgorithmSuite.cs
- HttpDateParse.cs
- GenericWebPart.cs
- UndoEngine.cs
- JsonEncodingStreamWrapper.cs
- PersonalizationState.cs
- IntSecurity.cs
- ToolStripDesignerUtils.cs
- HttpListenerElement.cs
- TrackPoint.cs
- KeyValuePairs.cs
- ServerIdentity.cs
- SchemaImporter.cs
- StringResourceManager.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DiagnosticStrings.cs
- WriteTimeStream.cs
- SmtpMail.cs
- X509Utils.cs
- __ComObject.cs
- CopyAttributesAction.cs
- CollectionViewGroupInternal.cs
- RegionInfo.cs
- Assembly.cs
- XsdCachingReader.cs
- HandlerFactoryCache.cs
- VersionedStream.cs
- DocumentOrderQuery.cs
- AppSettingsExpressionEditor.cs
- TypeProvider.cs
- Vector3DAnimationUsingKeyFrames.cs
- COAUTHINFO.cs
- COM2ColorConverter.cs
- MediaPlayerState.cs
- GlyphTypeface.cs
- Formatter.cs
- DateTimeUtil.cs
- PathGradientBrush.cs
- GcSettings.cs
- TreeNodeStyleCollection.cs
- InkCollectionBehavior.cs
- HandlerBase.cs
- ISAPIWorkerRequest.cs
- GridItem.cs
- ServiceAuthorizationBehavior.cs
- objectresult_tresulttype.cs
- DesignerEditorPartChrome.cs
- PrintDialog.cs
- TimeEnumHelper.cs
- LocalizationCodeDomSerializer.cs
- MailDefinitionBodyFileNameEditor.cs
- TableHeaderCell.cs
- DataTableMappingCollection.cs
- DebuggerAttributes.cs
- ClientSettingsProvider.cs
- QuaternionValueSerializer.cs
- SqlAliaser.cs
- GraphicsPathIterator.cs
- DispatcherProcessingDisabled.cs
- NodeLabelEditEvent.cs
- BatchStream.cs
- DateTimeUtil.cs