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
- AddInContractAttribute.cs
- ResourceDescriptionAttribute.cs
- DoubleAnimationUsingPath.cs
- UdpChannelFactory.cs
- BinaryFormatter.cs
- ServiceRouteHandler.cs
- PlatformCulture.cs
- _BasicClient.cs
- Translator.cs
- ConstraintConverter.cs
- SmiXetterAccessMap.cs
- ContextStaticAttribute.cs
- SortedSetDebugView.cs
- TextRangeProviderWrapper.cs
- MD5Cng.cs
- GeneralTransformCollection.cs
- ControlPager.cs
- BindValidator.cs
- _ListenerResponseStream.cs
- ProviderException.cs
- DecoderNLS.cs
- JobInputBins.cs
- ValidationError.cs
- TreeViewImageKeyConverter.cs
- Stopwatch.cs
- DefaultSerializationProviderAttribute.cs
- MultiViewDesigner.cs
- IssuanceTokenProviderBase.cs
- InvalidFilterCriteriaException.cs
- FileDialogCustomPlace.cs
- XsltConvert.cs
- ExclusiveHandleList.cs
- ExtensionDataObject.cs
- RtType.cs
- JsonStringDataContract.cs
- TextEncodedRawTextWriter.cs
- KnownTypes.cs
- DesignConnectionCollection.cs
- QueryCursorEventArgs.cs
- GregorianCalendarHelper.cs
- TextShapeableCharacters.cs
- SqlNamer.cs
- SoapProcessingBehavior.cs
- XdrBuilder.cs
- EncryptedType.cs
- BaseTemplateBuildProvider.cs
- SmiMetaData.cs
- ContentPlaceHolder.cs
- ObjectPropertyMapping.cs
- EncodingDataItem.cs
- ProcessInfo.cs
- BackStopAuthenticationModule.cs
- QilUnary.cs
- PolicyFactory.cs
- ToolBarTray.cs
- ExcCanonicalXml.cs
- TextRange.cs
- RadioButton.cs
- StoreItemCollection.Loader.cs
- ObjectListCommandsPage.cs
- ReversePositionQuery.cs
- AnimationStorage.cs
- WrappedIUnknown.cs
- XmlIgnoreAttribute.cs
- RuntimeConfigLKG.cs
- CreateUserWizardStep.cs
- ProcessProtocolHandler.cs
- SQLGuidStorage.cs
- XmlAutoDetectWriter.cs
- HtmlValidatorAdapter.cs
- DesignerLabelAdapter.cs
- EntityViewContainer.cs
- PropertyDescriptorComparer.cs
- WebPartRestoreVerb.cs
- AttributeSetAction.cs
- RowType.cs
- ProjectionPlan.cs
- ProjectionCamera.cs
- GradientStop.cs
- MdiWindowListItemConverter.cs
- EncoderExceptionFallback.cs
- ValueUtilsSmi.cs
- AspCompat.cs
- HighContrastHelper.cs
- BlurEffect.cs
- SystemWebSectionGroup.cs
- StatusBarPanel.cs
- UndoEngine.cs
- GlyphRunDrawing.cs
- PointAnimationBase.cs
- HttpGetClientProtocol.cs
- ErrorWebPart.cs
- FusionWrap.cs
- NeutralResourcesLanguageAttribute.cs
- Durable.cs
- ErrorWrapper.cs
- ScrollPattern.cs
- DoubleAverageAggregationOperator.cs
- WizardForm.cs
- TableNameAttribute.cs