Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / FileDataSourceCache.cs / 1 / FileDataSourceCache.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.Collections.Specialized; using System.Web.Caching; internal sealed class FileDataSourceCache : DataSourceCache { private StringCollection _fileDependencies; ////// Sets the list of files that the cache entry will be dependent on. /// These values are not stored in view state. /// public StringCollection FileDependencies { get { if (_fileDependencies == null) { _fileDependencies = new StringCollection(); } return _fileDependencies; } } ////// Saves data to the ASP.NET cache using the specified key. /// protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) { int fileCount = FileDependencies.Count; string[] filenames = new string[fileCount]; FileDependencies.CopyTo(filenames, 0); CacheDependency fileDependency = new CacheDependency(0, filenames); if (dependency != null) { // There was another dependency passed in, aggregate them AggregateCacheDependency aggregateDependency = new AggregateCacheDependency(); aggregateDependency.Add(fileDependency, dependency); dependency = aggregateDependency; } else { // No other dependencies, just the file one dependency = fileDependency; } base.SaveDataToCacheInternal(key, data, dependency); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.Collections.Specialized; using System.Web.Caching; internal sealed class FileDataSourceCache : DataSourceCache { private StringCollection _fileDependencies; ////// Sets the list of files that the cache entry will be dependent on. /// These values are not stored in view state. /// public StringCollection FileDependencies { get { if (_fileDependencies == null) { _fileDependencies = new StringCollection(); } return _fileDependencies; } } ////// Saves data to the ASP.NET cache using the specified key. /// protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) { int fileCount = FileDependencies.Count; string[] filenames = new string[fileCount]; FileDependencies.CopyTo(filenames, 0); CacheDependency fileDependency = new CacheDependency(0, filenames); if (dependency != null) { // There was another dependency passed in, aggregate them AggregateCacheDependency aggregateDependency = new AggregateCacheDependency(); aggregateDependency.Add(fileDependency, dependency); dependency = aggregateDependency; } else { // No other dependencies, just the file one dependency = fileDependency; } base.SaveDataToCacheInternal(key, data, dependency); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- lengthconverter.cs
- ImageListImage.cs
- ValueUnavailableException.cs
- Cell.cs
- MetadataArtifactLoader.cs
- DeleteStoreRequest.cs
- DataGridViewRowPrePaintEventArgs.cs
- TextDecorationCollection.cs
- _ProxyChain.cs
- HideDisabledControlAdapter.cs
- EventSourceCreationData.cs
- SecurityAlgorithmSuiteConverter.cs
- GAC.cs
- FormatterServices.cs
- COM2FontConverter.cs
- HistoryEventArgs.cs
- PenThreadPool.cs
- ClientFormsIdentity.cs
- ParserHooks.cs
- PointUtil.cs
- SiteMembershipCondition.cs
- CacheManager.cs
- EntityDataSourceChangedEventArgs.cs
- SchemaInfo.cs
- DataColumnCollection.cs
- CapiSymmetricAlgorithm.cs
- MetadataSource.cs
- XmlBinaryWriterSession.cs
- ListComponentEditor.cs
- DSASignatureFormatter.cs
- ItemAutomationPeer.cs
- cookieexception.cs
- DecoderNLS.cs
- DocumentSequence.cs
- CompositeControl.cs
- RequestResizeEvent.cs
- UserPersonalizationStateInfo.cs
- SerializerWriterEventHandlers.cs
- BoundsDrawingContextWalker.cs
- SecurityDescriptor.cs
- RemoteWebConfigurationHostStream.cs
- OperatorExpressions.cs
- TimeoutConverter.cs
- ExtensionSimplifierMarkupObject.cs
- GPRECTF.cs
- AssemblyUtil.cs
- WebPartPersonalization.cs
- ColorMatrix.cs
- COMException.cs
- QilExpression.cs
- HttpConfigurationContext.cs
- XmlAttribute.cs
- StylusEventArgs.cs
- EdgeProfileValidation.cs
- XmlCharCheckingReader.cs
- InvokeMethodActivity.cs
- CellCreator.cs
- PersistenceTypeAttribute.cs
- remotingproxy.cs
- Typography.cs
- CustomPopupPlacement.cs
- ScrollEventArgs.cs
- EditorPartCollection.cs
- XmlLanguageConverter.cs
- IDictionary.cs
- EventPrivateKey.cs
- DataTableMapping.cs
- ServiceEndpointElementCollection.cs
- ConnectionManagementElementCollection.cs
- CodePageUtils.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- ImmutableAssemblyCacheEntry.cs
- Point3DValueSerializer.cs
- CapabilitiesPattern.cs
- UpdatePanel.cs
- EventLogPropertySelector.cs
- SecurityDocument.cs
- ClientClassGenerator.cs
- ReadOnlyPropertyMetadata.cs
- Adorner.cs
- SymbolEqualComparer.cs
- Image.cs
- Transform.cs
- DecoderFallbackWithFailureFlag.cs
- ClientUrlResolverWrapper.cs
- XmlAnyElementAttributes.cs
- IndexOutOfRangeException.cs
- SatelliteContractVersionAttribute.cs
- ContainerSelectorGlyph.cs
- TextWriterTraceListener.cs
- SecureStringHasher.cs
- WindowsTitleBar.cs
- WaveHeader.cs
- NodeCounter.cs
- DataGridCommandEventArgs.cs
- SqlCacheDependency.cs
- ComplexType.cs
- Expressions.cs
- RuntimeConfigurationRecord.cs
- DataGridViewCell.cs