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
- SchemaNotation.cs
- _ListenerRequestStream.cs
- ToolZone.cs
- JulianCalendar.cs
- OdbcConnectionOpen.cs
- CodeMemberMethod.cs
- StreamGeometryContext.cs
- Expression.DebuggerProxy.cs
- WinFormsUtils.cs
- DetailsViewRow.cs
- ReadOnlyDataSourceView.cs
- WSHttpBindingCollectionElement.cs
- TypeToken.cs
- XamlPointCollectionSerializer.cs
- TargetConverter.cs
- UserPreferenceChangedEventArgs.cs
- Expressions.cs
- ConfigUtil.cs
- ImpersonateTokenRef.cs
- TextDecoration.cs
- TraceSection.cs
- FormsAuthenticationCredentials.cs
- NotifyCollectionChangedEventArgs.cs
- PageHandlerFactory.cs
- TextViewBase.cs
- LinqDataSourceContextData.cs
- MILUtilities.cs
- SafeSystemMetrics.cs
- DataGridViewCellStyle.cs
- ImageMap.cs
- MailAddress.cs
- SecureUICommand.cs
- FieldToken.cs
- TitleStyle.cs
- SafeNativeMethods.cs
- HtmlTableRow.cs
- CommonGetThemePartSize.cs
- DragEventArgs.cs
- ExtensionQuery.cs
- DataGridViewButtonCell.cs
- QueryCacheKey.cs
- DropShadowEffect.cs
- DataPager.cs
- MultiView.cs
- InheritanceAttribute.cs
- AdornerPresentationContext.cs
- JournalNavigationScope.cs
- SHA1Managed.cs
- StyleBamlRecordReader.cs
- TransformerConfigurationWizardBase.cs
- ConfigurationSectionHelper.cs
- StylusPoint.cs
- CodeGeneratorAttribute.cs
- ExceptionWrapper.cs
- X509DefaultServiceCertificateElement.cs
- GlobalizationSection.cs
- NetStream.cs
- DependsOnAttribute.cs
- StandardBindingCollectionElement.cs
- TextTreeInsertElementUndoUnit.cs
- StylusButton.cs
- MimeTypePropertyAttribute.cs
- NominalTypeEliminator.cs
- NumericExpr.cs
- WebControl.cs
- ButtonBaseAdapter.cs
- ProviderManager.cs
- DefaultPerformanceCounters.cs
- DataGridViewCellParsingEventArgs.cs
- Rotation3DAnimationBase.cs
- FormViewCommandEventArgs.cs
- TrustLevel.cs
- Win32Native.cs
- RowUpdatingEventArgs.cs
- MulticastNotSupportedException.cs
- RoutedEventHandlerInfo.cs
- ScaleTransform.cs
- WebPartUserCapability.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- DataGridViewLinkCell.cs
- XmlSchemaAnyAttribute.cs
- TimerEventSubscriptionCollection.cs
- CatalogPartCollection.cs
- ToolStripContentPanelRenderEventArgs.cs
- SvcMapFile.cs
- CriticalFinalizerObject.cs
- SystemGatewayIPAddressInformation.cs
- DependsOnAttribute.cs
- ToolStripHighContrastRenderer.cs
- RenderDataDrawingContext.cs
- XamlHostingSection.cs
- IResourceProvider.cs
- AssociationSet.cs
- WeakReference.cs
- KeyEvent.cs
- WrappedReader.cs
- AppDomainGrammarProxy.cs
- Socket.cs
- DisableDpiAwarenessAttribute.cs
- StringSorter.cs