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
- SecondaryViewProvider.cs
- CheckBoxField.cs
- HttpCookie.cs
- ListManagerBindingsCollection.cs
- DbProviderFactoriesConfigurationHandler.cs
- SHA512.cs
- DetailsViewDeletedEventArgs.cs
- RSACryptoServiceProvider.cs
- NeutralResourcesLanguageAttribute.cs
- DataGridColumnsPage.cs
- MobileUserControl.cs
- ProcessInfo.cs
- EmptyReadOnlyDictionaryInternal.cs
- SimpleLine.cs
- DispatcherFrame.cs
- WebDescriptionAttribute.cs
- SqlProcedureAttribute.cs
- VerificationAttribute.cs
- XPathConvert.cs
- FrameSecurityDescriptor.cs
- ListenerPerfCounters.cs
- ReturnType.cs
- TableLayout.cs
- CounterCreationDataConverter.cs
- DispatcherExceptionEventArgs.cs
- ComponentEditorForm.cs
- AdapterUtil.cs
- RecognitionEventArgs.cs
- MenuItemCollection.cs
- ObjectDataSourceView.cs
- CapabilitiesUse.cs
- FrameworkContextData.cs
- CuspData.cs
- ConvertersCollection.cs
- ByteStack.cs
- PieceDirectory.cs
- CodeBinaryOperatorExpression.cs
- SharedPersonalizationStateInfo.cs
- SortFieldComparer.cs
- InheritanceRules.cs
- WebBrowserContainer.cs
- TreeNodeCollection.cs
- ServiceSettingsResponseInfo.cs
- MergeEnumerator.cs
- XmlSchemaProviderAttribute.cs
- ObjectItemAssemblyLoader.cs
- LinearGradientBrush.cs
- TableDesigner.cs
- FontStretch.cs
- LOSFormatter.cs
- WebPartEditVerb.cs
- ContractNamespaceAttribute.cs
- HtmlInputReset.cs
- XmlChildNodes.cs
- ToolTip.cs
- GroupBoxAutomationPeer.cs
- Utils.cs
- RectAnimationClockResource.cs
- CompileXomlTask.cs
- FlowDocumentPaginator.cs
- WebServiceData.cs
- SpoolingTask.cs
- TextRangeProviderWrapper.cs
- Ref.cs
- Wildcard.cs
- GridPattern.cs
- Size3D.cs
- DocumentAutomationPeer.cs
- ContainerControlDesigner.cs
- SignatureResourcePool.cs
- SoapProtocolImporter.cs
- storepermissionattribute.cs
- Predicate.cs
- MruCache.cs
- RenamedEventArgs.cs
- StateMachineTimers.cs
- Model3DGroup.cs
- FormsAuthentication.cs
- Marshal.cs
- FormClosingEvent.cs
- ControlValuePropertyAttribute.cs
- ImplicitInputBrush.cs
- SqlRecordBuffer.cs
- FlowLayout.cs
- SafeNativeMethods.cs
- JsonWriter.cs
- CharUnicodeInfo.cs
- IsolatedStorageException.cs
- DocumentGridContextMenu.cs
- SqlException.cs
- ExpressionBuilder.cs
- TypeHelper.cs
- RotationValidation.cs
- SortableBindingList.cs
- WebPartZoneBase.cs
- Crc32.cs
- SizeAnimation.cs
- WebRequestModuleElement.cs
- ToolStripMenuItem.cs
- SoapException.cs