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
- WeakReadOnlyCollection.cs
- MessageEventSubscriptionService.cs
- HandleTable.cs
- IsolatedStoragePermission.cs
- TransformerTypeCollection.cs
- SiteMapNode.cs
- DataGridColumnHeadersPresenter.cs
- FileNotFoundException.cs
- DataSetMappper.cs
- ModelItemDictionaryImpl.cs
- SocketAddress.cs
- MarginCollapsingState.cs
- SearchForVirtualItemEventArgs.cs
- sqlstateclientmanager.cs
- CaseKeyBox.xaml.cs
- XamlGridLengthSerializer.cs
- EventWaitHandleSecurity.cs
- SHA256Managed.cs
- MenuBase.cs
- Metadata.cs
- EventManager.cs
- AudioFormatConverter.cs
- PageParser.cs
- BmpBitmapEncoder.cs
- TextCharacters.cs
- ListControl.cs
- TextShapeableCharacters.cs
- XPathMessageFilterElementCollection.cs
- ReturnEventArgs.cs
- XmlSchemaSet.cs
- KoreanLunisolarCalendar.cs
- Encoder.cs
- SqlCachedBuffer.cs
- SpotLight.cs
- NullToBooleanConverter.cs
- AddInAttribute.cs
- ActivitySurrogateSelector.cs
- SiteMembershipCondition.cs
- NotificationContext.cs
- ChildDocumentBlock.cs
- ResolveNameEventArgs.cs
- Converter.cs
- DataGridViewTextBoxEditingControl.cs
- NullableFloatMinMaxAggregationOperator.cs
- ProviderBase.cs
- WebMethodAttribute.cs
- SimpleHandlerFactory.cs
- MenuItem.cs
- GridViewRowCollection.cs
- SettingsAttributeDictionary.cs
- ViewPort3D.cs
- QilFactory.cs
- DesignerActionUIService.cs
- AssemblyUtil.cs
- IssuedSecurityTokenParameters.cs
- SafeEventLogWriteHandle.cs
- BufferAllocator.cs
- ScriptReferenceBase.cs
- TransformValueSerializer.cs
- ListSourceHelper.cs
- ColorPalette.cs
- FocusManager.cs
- SafeProcessHandle.cs
- MenuItemBinding.cs
- TrackingMemoryStream.cs
- AutomationProperties.cs
- Nodes.cs
- TripleDES.cs
- DataSpaceManager.cs
- SharedUtils.cs
- ImpersonationContext.cs
- SchemaMerger.cs
- StringComparer.cs
- WebPart.cs
- DocumentEventArgs.cs
- InputManager.cs
- ServiceModelConfiguration.cs
- ShaderEffect.cs
- ViewUtilities.cs
- Keywords.cs
- EtwTrace.cs
- HTTPRemotingHandler.cs
- DataSourceControl.cs
- SQLStringStorage.cs
- CustomErrorsSectionWrapper.cs
- SiteMapNode.cs
- GetPageNumberCompletedEventArgs.cs
- Trigger.cs
- SqlProviderServices.cs
- HtmlInputFile.cs
- Descriptor.cs
- PrivilegedConfigurationManager.cs
- xmlsaver.cs
- XmlHierarchyData.cs
- IxmlLineInfo.cs
- ServiceParser.cs
- AppLevelCompilationSectionCache.cs
- SQLChars.cs
- EdmToObjectNamespaceMap.cs
- MediaPlayerState.cs