Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / QueryCache / QueryCacheKey.cs / 1 / 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
- PropertyGeneratedEventArgs.cs
- CurrentChangedEventManager.cs
- PropertyItem.cs
- HMACSHA1.cs
- DataGridViewRowEventArgs.cs
- GeometryModel3D.cs
- AbstractSvcMapFileLoader.cs
- ValidateNames.cs
- ProfessionalColors.cs
- CacheEntry.cs
- SettingsProperty.cs
- CanExecuteRoutedEventArgs.cs
- CompositeFontFamily.cs
- AuthenticationModulesSection.cs
- AlphabeticalEnumConverter.cs
- AllowedAudienceUriElementCollection.cs
- Label.cs
- ObjectNotFoundException.cs
- NavigationWindowAutomationPeer.cs
- PixelFormats.cs
- ToolboxComponentsCreatingEventArgs.cs
- ConfigurationValidatorBase.cs
- Compiler.cs
- IdentityNotMappedException.cs
- ProtocolsConfigurationHandler.cs
- TypeRefElement.cs
- HttpContext.cs
- PathNode.cs
- SchemaManager.cs
- COSERVERINFO.cs
- CodeTypeReferenceExpression.cs
- LicenseManager.cs
- SoapIgnoreAttribute.cs
- SspiSafeHandles.cs
- ControlAdapter.cs
- SwitchAttribute.cs
- LogEntryHeaderDeserializer.cs
- util.cs
- TransformCollection.cs
- WSSecureConversation.cs
- PasswordTextContainer.cs
- Helpers.cs
- VirtualizingPanel.cs
- RecordManager.cs
- TableMethodGenerator.cs
- MembershipValidatePasswordEventArgs.cs
- LoginNameDesigner.cs
- DataServiceExpressionVisitor.cs
- DataObjectSettingDataEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- RepeaterCommandEventArgs.cs
- IntegerValidator.cs
- UpdateExpressionVisitor.cs
- DataGridColumnEventArgs.cs
- AssemblyName.cs
- Model3DGroup.cs
- MatrixCamera.cs
- XsdValidatingReader.cs
- Control.cs
- ApplicationSecurityManager.cs
- ReachDocumentSequenceSerializerAsync.cs
- XmlChildNodes.cs
- SmiMetaDataProperty.cs
- TreePrinter.cs
- TextFormattingConverter.cs
- SafeRegistryKey.cs
- DataTemplate.cs
- ComponentDispatcher.cs
- xamlnodes.cs
- BaseInfoTable.cs
- XslVisitor.cs
- SimpleTextLine.cs
- WebBrowserBase.cs
- Debug.cs
- Table.cs
- Camera.cs
- ServiceDesigner.xaml.cs
- DispatcherOperation.cs
- XmlRawWriterWrapper.cs
- CodeRemoveEventStatement.cs
- XmlReflectionImporter.cs
- System.Data_BID.cs
- AttributeProviderAttribute.cs
- UndoEngine.cs
- UserControl.cs
- Label.cs
- DropTarget.cs
- CredentialCache.cs
- EncryptedKey.cs
- MulticastNotSupportedException.cs
- SamlAdvice.cs
- SpecularMaterial.cs
- RoutedEvent.cs
- Stream.cs
- SizeAnimationUsingKeyFrames.cs
- Sql8ConformanceChecker.cs
- UnsignedPublishLicense.cs
- AttachedProperty.cs
- CompositeActivityMarkupSerializer.cs
- FrameworkElementAutomationPeer.cs