Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- EdmSchemaAttribute.cs
- ChannelDispatcherCollection.cs
- KnownTypesHelper.cs
- InternalResources.cs
- ProxyAssemblyNotLoadedException.cs
- ReturnType.cs
- MetadataPropertyCollection.cs
- ViewLoader.cs
- CodeCommentStatementCollection.cs
- LinqToSqlWrapper.cs
- XmlILIndex.cs
- XomlCompilerHelpers.cs
- Pen.cs
- ConnectionStringsExpressionBuilder.cs
- Margins.cs
- FromReply.cs
- ZipIOLocalFileBlock.cs
- Rect.cs
- WebPartRestoreVerb.cs
- ResourceReferenceKeyNotFoundException.cs
- ObjectContextServiceProvider.cs
- ChameleonKey.cs
- MatrixUtil.cs
- WebControl.cs
- XmlSchemaChoice.cs
- RegexMatch.cs
- IndexedEnumerable.cs
- Converter.cs
- Stack.cs
- OdbcCommand.cs
- CodeGenerator.cs
- Msec.cs
- ActivityUtilities.cs
- Rect3DConverter.cs
- WindowsBrush.cs
- AssemblyAttributes.cs
- AdPostCacheSubstitution.cs
- ZipFileInfoCollection.cs
- ContextQuery.cs
- SmiEventSink_Default.cs
- WinFormsSecurity.cs
- DropDownList.cs
- ExpressionParser.cs
- StartUpEventArgs.cs
- SingleBodyParameterMessageFormatter.cs
- ByteRangeDownloader.cs
- DocumentViewerBaseAutomationPeer.cs
- FormatException.cs
- ProcessModelInfo.cs
- uribuilder.cs
- Aes.cs
- FontStretchConverter.cs
- Span.cs
- DefaultProxySection.cs
- IIS7WorkerRequest.cs
- ToolBarPanel.cs
- ApplicationServiceHelper.cs
- SqlPersonalizationProvider.cs
- ArraySet.cs
- DataRecordObjectView.cs
- TreeView.cs
- TraceSwitch.cs
- TextSerializer.cs
- SoapElementAttribute.cs
- TemplateColumn.cs
- SerializationAttributes.cs
- MessageSecurityVersion.cs
- MenuItemBinding.cs
- StructuredProperty.cs
- SqlSelectStatement.cs
- FileFormatException.cs
- MultiBinding.cs
- BaseTemplatedMobileComponentEditor.cs
- TextServicesContext.cs
- unsafeIndexingFilterStream.cs
- Lock.cs
- DynamicQueryableWrapper.cs
- NullNotAllowedCollection.cs
- XPathDocument.cs
- DataSourceListEditor.cs
- PageFunction.cs
- RequestResizeEvent.cs
- ProviderSettingsCollection.cs
- ReadOnlyNameValueCollection.cs
- SingletonInstanceContextProvider.cs
- documentsequencetextcontainer.cs
- XmlName.cs
- ObjectHelper.cs
- PostBackOptions.cs
- NoClickablePointException.cs
- TeredoHelper.cs
- GiveFeedbackEventArgs.cs
- TargetParameterCountException.cs
- HandledMouseEvent.cs
- UnauthorizedAccessException.cs
- PathFigure.cs
- XmlSequenceWriter.cs
- CancelEventArgs.cs
- ConversionContext.cs
- SqlSelectStatement.cs