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
- DataServiceProcessingPipelineEventArgs.cs
- ReflectionHelper.cs
- TaskHelper.cs
- UniqueConstraint.cs
- ServicePointManager.cs
- QilXmlWriter.cs
- SqlRowUpdatedEvent.cs
- DataGridCellsPresenter.cs
- unitconverter.cs
- RbTree.cs
- BookmarkEventArgs.cs
- PixelFormat.cs
- DataGridItemAttachedStorage.cs
- VirtualizingPanel.cs
- SignedInfo.cs
- DataException.cs
- storagemappingitemcollection.viewdictionary.cs
- AssemblyInfo.cs
- ColumnTypeConverter.cs
- CodeTypeParameterCollection.cs
- UpdatePanelTriggerCollection.cs
- TextTrailingWordEllipsis.cs
- RuntimeCompatibilityAttribute.cs
- WebHttpSecurity.cs
- ImageCreator.cs
- HashAlgorithm.cs
- ModifierKeysConverter.cs
- SerializationInfo.cs
- ClientSideProviderDescription.cs
- securitycriticaldata.cs
- SynchronizedDispatch.cs
- WebUtil.cs
- TextEmbeddedObject.cs
- ListBindableAttribute.cs
- UpDownBase.cs
- LinkedResource.cs
- HandledEventArgs.cs
- DBSqlParserTable.cs
- ChooseAction.cs
- BinaryFormatter.cs
- GridViewColumnHeaderAutomationPeer.cs
- NativeMethods.cs
- SafeProcessHandle.cs
- StrongNamePublicKeyBlob.cs
- CfgRule.cs
- InstanceDataCollection.cs
- ClientBuildManagerCallback.cs
- OlePropertyStructs.cs
- SrgsRuleRef.cs
- RootAction.cs
- PageRequestManager.cs
- Simplifier.cs
- PromptBuilder.cs
- RadioButton.cs
- SqlProvider.cs
- DataTemplateKey.cs
- XmlDomTextWriter.cs
- DSASignatureDeformatter.cs
- SectionVisual.cs
- SmiRequestExecutor.cs
- LookupNode.cs
- FilterException.cs
- HttpModuleCollection.cs
- DataViewManagerListItemTypeDescriptor.cs
- ZipIOExtraField.cs
- CodeMethodReturnStatement.cs
- UrlMappingsModule.cs
- CaseInsensitiveHashCodeProvider.cs
- Crypto.cs
- SchemaTableColumn.cs
- SamlAttributeStatement.cs
- Number.cs
- IPHostEntry.cs
- XPathExpr.cs
- SynchronizedPool.cs
- ChangeDirector.cs
- HotSpot.cs
- StateManagedCollection.cs
- ExpandableObjectConverter.cs
- X509Utils.cs
- PageParserFilter.cs
- Privilege.cs
- CollectionContainer.cs
- DragDropHelper.cs
- TransformGroup.cs
- StringInfo.cs
- DocComment.cs
- QuinticEase.cs
- HttpModuleActionCollection.cs
- CompareInfo.cs
- CustomSignedXml.cs
- DebugInfoGenerator.cs
- TextProperties.cs
- StylusEditingBehavior.cs
- PermissionListSet.cs
- ObjectViewEntityCollectionData.cs
- StrongNamePublicKeyBlob.cs
- HtmlInputText.cs
- PictureBoxDesigner.cs
- HostedHttpRequestAsyncResult.cs