Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EncodingInfo.cs
- EditorAttributeInfo.cs
- ClaimSet.cs
- PtsHelper.cs
- DbParameterHelper.cs
- WebPartCancelEventArgs.cs
- Tile.cs
- MexServiceChannelBuilder.cs
- AuthenticationManager.cs
- MiniModule.cs
- StorageFunctionMapping.cs
- ManualResetEvent.cs
- SizeIndependentAnimationStorage.cs
- MediaElementAutomationPeer.cs
- BaseAsyncResult.cs
- _NetworkingPerfCounters.cs
- TypeDelegator.cs
- ValueTable.cs
- cookiecontainer.cs
- HttpListenerPrefixCollection.cs
- EncoderFallback.cs
- CustomAttributeFormatException.cs
- DiagnosticsConfigurationHandler.cs
- Expander.cs
- DrawingCollection.cs
- InternalMappingException.cs
- Rotation3D.cs
- BaseParser.cs
- ValidationRule.cs
- DbDataAdapter.cs
- EventLogEntry.cs
- BlobPersonalizationState.cs
- MsmqProcessProtocolHandler.cs
- PassportIdentity.cs
- PrintDialog.cs
- ObjectDataSourceEventArgs.cs
- EventLogPermissionEntryCollection.cs
- DNS.cs
- RepeatBehaviorConverter.cs
- MasterPageParser.cs
- NotifyCollectionChangedEventArgs.cs
- ProviderIncompatibleException.cs
- MostlySingletonList.cs
- BezierSegment.cs
- GridView.cs
- InstanceNameConverter.cs
- CallbackValidatorAttribute.cs
- EncoderParameters.cs
- MsmqIntegrationProcessProtocolHandler.cs
- GridViewCommandEventArgs.cs
- AuthenticationModulesSection.cs
- AsyncDataRequest.cs
- Control.cs
- SocketInformation.cs
- TabletDeviceInfo.cs
- TextRangeEditLists.cs
- TransformerInfo.cs
- LeftCellWrapper.cs
- UserUseLicenseDictionaryLoader.cs
- CapiSafeHandles.cs
- UIElementParagraph.cs
- RectAnimationClockResource.cs
- XmlStringTable.cs
- TabControlAutomationPeer.cs
- PolygonHotSpot.cs
- DeferredReference.cs
- ObjectSet.cs
- Geometry.cs
- PersonalizablePropertyEntry.cs
- BitmapEffectInput.cs
- Figure.cs
- TreeNodeClickEventArgs.cs
- EnumerableRowCollectionExtensions.cs
- UmAlQuraCalendar.cs
- Table.cs
- OperatingSystem.cs
- XmlNodeList.cs
- CrossContextChannel.cs
- ConnectionConsumerAttribute.cs
- EventHandlingScope.cs
- StopStoryboard.cs
- CharAnimationBase.cs
- DataRow.cs
- ProfileParameter.cs
- ContextProperty.cs
- AstTree.cs
- XmlDataSourceDesigner.cs
- BitConverter.cs
- CollectionViewGroupRoot.cs
- CustomDictionarySources.cs
- FileLogRecord.cs
- UnsignedPublishLicense.cs
- KnownColorTable.cs
- ClientConfigurationSystem.cs
- CapabilitiesAssignment.cs
- SiteMapNode.cs
- SpeechSynthesizer.cs
- SurrogateEncoder.cs
- WebControlAdapter.cs
- WindowsStatusBar.cs