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
- HtmlTernaryTree.cs
- BufferedOutputStream.cs
- ListViewInsertionMark.cs
- SubstitutionResponseElement.cs
- initElementDictionary.cs
- WebExceptionStatus.cs
- SiteMapNodeCollection.cs
- PrePrepareMethodAttribute.cs
- DiscoveryEndpointElement.cs
- WindowsListViewScroll.cs
- ConfigurationManagerHelperFactory.cs
- TextRange.cs
- XmlReflectionMember.cs
- XPathMultyIterator.cs
- PerspectiveCamera.cs
- Figure.cs
- Debugger.cs
- PolyQuadraticBezierSegment.cs
- ActiveDocumentEvent.cs
- ISAPIRuntime.cs
- FactoryMaker.cs
- ProcessModule.cs
- DataGridViewColumnStateChangedEventArgs.cs
- storepermission.cs
- DescendantOverDescendantQuery.cs
- CellParagraph.cs
- DataBindEngine.cs
- WebResourceUtil.cs
- NativeBuffer.cs
- WeakReferenceKey.cs
- Calendar.cs
- TextPatternIdentifiers.cs
- MimeFormatter.cs
- DateTimeStorage.cs
- SingleAnimationUsingKeyFrames.cs
- WebPartConnectionCollection.cs
- ConfigsHelper.cs
- WebBrowser.cs
- FontCacheUtil.cs
- Vector3DCollectionValueSerializer.cs
- Crc32Helper.cs
- SatelliteContractVersionAttribute.cs
- SafeCryptoHandles.cs
- EncryptedType.cs
- RootBuilder.cs
- versioninfo.cs
- TaskbarItemInfo.cs
- MexHttpsBindingElement.cs
- Annotation.cs
- SqlCachedBuffer.cs
- Misc.cs
- PeerCollaborationPermission.cs
- LongAverageAggregationOperator.cs
- SessionStateItemCollection.cs
- SqlConnectionHelper.cs
- Command.cs
- ForwardPositionQuery.cs
- AvTrace.cs
- TextPenaltyModule.cs
- ThrowHelper.cs
- SchemaType.cs
- StylusCaptureWithinProperty.cs
- MouseActionValueSerializer.cs
- ReliabilityContractAttribute.cs
- LogRestartAreaEnumerator.cs
- SingleTagSectionHandler.cs
- FixedTextView.cs
- ConnectionPointCookie.cs
- Evaluator.cs
- XmlSchemaObjectTable.cs
- BuilderPropertyEntry.cs
- OperationParameterInfoCollection.cs
- LinqDataSourceDisposeEventArgs.cs
- LogRestartAreaEnumerator.cs
- FastPropertyAccessor.cs
- BaseHashHelper.cs
- Encoder.cs
- StringReader.cs
- CqlWriter.cs
- CodeArrayCreateExpression.cs
- List.cs
- DateTimeValueSerializer.cs
- ConnectionPoint.cs
- ScrollEvent.cs
- WeakEventManager.cs
- UshortList2.cs
- PropertyPath.cs
- StringSource.cs
- QuaternionConverter.cs
- PolyLineSegment.cs
- LinqDataSource.cs
- GeneralTransform2DTo3DTo2D.cs
- PrivacyNoticeBindingElement.cs
- CodeSnippetCompileUnit.cs
- ValidationResult.cs
- CodeExporter.cs
- ShowExpandedMultiValueConverter.cs
- RecommendedAsConfigurableAttribute.cs
- Exception.cs
- StrictAndMessageFilter.cs