Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- TemplateControlBuildProvider.cs
- JsonDeserializer.cs
- JavaScriptSerializer.cs
- BrowserTree.cs
- TabletDeviceInfo.cs
- SecurityValidationBehavior.cs
- SqlDependencyListener.cs
- TraceListeners.cs
- RelationshipType.cs
- BidPrivateBase.cs
- ResourceDescriptionAttribute.cs
- ByteStack.cs
- ReaderWriterLockWrapper.cs
- HebrewCalendar.cs
- WebMessageEncodingElement.cs
- ServiceDesigner.cs
- ByeMessageApril2005.cs
- ControlUtil.cs
- ServicePointManagerElement.cs
- sapiproxy.cs
- DataViewManagerListItemTypeDescriptor.cs
- StreamReader.cs
- Vector3D.cs
- PageBuildProvider.cs
- SoapParser.cs
- IntranetCredentialPolicy.cs
- TextTreeRootNode.cs
- InvokePatternIdentifiers.cs
- BufferedReadStream.cs
- ComboBoxItem.cs
- AnnotationResourceCollection.cs
- DecimalKeyFrameCollection.cs
- XmlIgnoreAttribute.cs
- IncrementalCompileAnalyzer.cs
- ProgressChangedEventArgs.cs
- InputLanguageManager.cs
- TemplateBuilder.cs
- AnnotationHelper.cs
- Property.cs
- webeventbuffer.cs
- PeerTransportBindingElement.cs
- MethodCallTranslator.cs
- TableItemPattern.cs
- SystemFonts.cs
- TextTreeDeleteContentUndoUnit.cs
- Page.cs
- RetrieveVirtualItemEventArgs.cs
- DBBindings.cs
- SmiTypedGetterSetter.cs
- UnknownWrapper.cs
- EndpointInstanceProvider.cs
- UntypedNullExpression.cs
- DbConnectionPoolGroupProviderInfo.cs
- CallbackException.cs
- CanonicalFontFamilyReference.cs
- Helpers.cs
- StringPropertyBuilder.cs
- AccessDataSourceView.cs
- CodeAttributeArgument.cs
- GlobalProxySelection.cs
- TraversalRequest.cs
- SecurityTokenAttachmentMode.cs
- _NegoStream.cs
- MutexSecurity.cs
- EntityDataSourceUtil.cs
- ZipIOModeEnforcingStream.cs
- SqlDataSourceStatusEventArgs.cs
- documentsequencetextcontainer.cs
- ExpressionPrefixAttribute.cs
- CornerRadiusConverter.cs
- EventSinkActivityDesigner.cs
- PtsHost.cs
- LessThan.cs
- AlternationConverter.cs
- DeploymentSection.cs
- BrowserCapabilitiesFactory.cs
- XmlSchemaNotation.cs
- ProfileEventArgs.cs
- CodeTypeDelegate.cs
- StringAttributeCollection.cs
- QuadraticBezierSegment.cs
- MimeWriter.cs
- MouseGestureConverter.cs
- WindowsMenu.cs
- BitmapVisualManager.cs
- NavigationProperty.cs
- Container.cs
- ContainerFilterService.cs
- MediaTimeline.cs
- EntityParameterCollection.cs
- DynamicDataManager.cs
- EventDescriptorCollection.cs
- TypeSystem.cs
- ClientSideProviderDescription.cs
- Constant.cs
- HttpHandlersSection.cs
- CoreSwitches.cs
- PropertyToken.cs
- ChannelSinkStacks.cs
- ScopeCollection.cs