Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / FileDataSourceCache.cs / 1305376 / 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
- ApplicationFileParser.cs
- RoleManagerEventArgs.cs
- DmlSqlGenerator.cs
- WindowsListViewGroup.cs
- SystemEvents.cs
- MetadataItemSerializer.cs
- DependsOnAttribute.cs
- Switch.cs
- NodeLabelEditEvent.cs
- ConditionalAttribute.cs
- XmlCodeExporter.cs
- EdmValidator.cs
- ToRequest.cs
- TriggerCollection.cs
- SoapSchemaMember.cs
- SplitterCancelEvent.cs
- GradientStop.cs
- ActivityValidator.cs
- StringConverter.cs
- SafeHandle.cs
- NativeCompoundFileAPIs.cs
- DataTableNewRowEvent.cs
- KeysConverter.cs
- FixedFlowMap.cs
- TableItemStyle.cs
- NestedContainer.cs
- GridViewItemAutomationPeer.cs
- RegexWorker.cs
- TypeToStringValueConverter.cs
- WebEventCodes.cs
- KeyGestureValueSerializer.cs
- LogWriteRestartAreaState.cs
- UmAlQuraCalendar.cs
- RequestQueryProcessor.cs
- CheckedListBox.cs
- Visual3D.cs
- AnnotationResource.cs
- XPathNode.cs
- MultipartIdentifier.cs
- SymmetricCryptoHandle.cs
- BitmapDecoder.cs
- MorphHelper.cs
- FontEditor.cs
- AnnotationResourceCollection.cs
- EntityDataSourceQueryBuilder.cs
- ParameterDataSourceExpression.cs
- WindowsListViewItemStartMenu.cs
- RedirectionProxy.cs
- ColorMatrix.cs
- LineProperties.cs
- ValueUnavailableException.cs
- basemetadatamappingvisitor.cs
- TableItemPatternIdentifiers.cs
- StylusPointDescription.cs
- EncoderBestFitFallback.cs
- TreeView.cs
- TimeSpanStorage.cs
- XsltQilFactory.cs
- FixedStringLookup.cs
- PageThemeBuildProvider.cs
- _SslSessionsCache.cs
- TransformedBitmap.cs
- DocumentScope.cs
- XPathBuilder.cs
- ContextMenuService.cs
- FileDialog_Vista.cs
- WindowsGraphicsCacheManager.cs
- GPRECTF.cs
- WebPartHelpVerb.cs
- QilScopedVisitor.cs
- Journaling.cs
- HostedHttpContext.cs
- VSWCFServiceContractGenerator.cs
- Parsers.cs
- SynchronizedPool.cs
- CheckableControlBaseAdapter.cs
- RequestResizeEvent.cs
- PageThemeCodeDomTreeGenerator.cs
- DbCommandTree.cs
- HtmlContainerControl.cs
- IOException.cs
- ErrorLog.cs
- MailMessage.cs
- MonitorWrapper.cs
- XmlSerializationReader.cs
- TextServicesDisplayAttribute.cs
- HeaderUtility.cs
- XMLSyntaxException.cs
- Reference.cs
- namescope.cs
- SchemaElementLookUpTableEnumerator.cs
- DataRowView.cs
- XmlTextReaderImplHelpers.cs
- Enumerable.cs
- HttpStreams.cs
- IndexerNameAttribute.cs
- TextAnchor.cs
- DataSvcMapFile.cs
- DataKeyArray.cs
- SliderAutomationPeer.cs