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
- ADMembershipUser.cs
- ImportException.cs
- XmlCollation.cs
- MutexSecurity.cs
- KnownTypes.cs
- HtmlInputHidden.cs
- XmlEntity.cs
- ArrayList.cs
- OdbcConnectionStringbuilder.cs
- PermissionToken.cs
- DesignDataSource.cs
- DesignerVerbToolStripMenuItem.cs
- counter.cs
- TraceListener.cs
- SizeConverter.cs
- TemplateControlBuildProvider.cs
- GeometryGroup.cs
- ReflectEventDescriptor.cs
- CodeDomComponentSerializationService.cs
- XPathNavigatorReader.cs
- ScrollData.cs
- UserControlCodeDomTreeGenerator.cs
- ClientSettings.cs
- GeometryDrawing.cs
- MediaEntryAttribute.cs
- HttpChannelHelper.cs
- SqlCacheDependencyDatabaseCollection.cs
- FamilyMap.cs
- VariableAction.cs
- AccessText.cs
- TemplateBindingExtensionConverter.cs
- SystemUnicastIPAddressInformation.cs
- SmtpDigestAuthenticationModule.cs
- BatchParser.cs
- ClientProtocol.cs
- UserInitiatedNavigationPermission.cs
- Char.cs
- DataServiceResponse.cs
- LoginName.cs
- IERequestCache.cs
- SetterBase.cs
- SqlRetyper.cs
- RegexWorker.cs
- SectionRecord.cs
- TextRunCacheImp.cs
- CodeIndexerExpression.cs
- ToolboxBitmapAttribute.cs
- ModifierKeysConverter.cs
- FormParameter.cs
- DeflateEmulationStream.cs
- WebMethodAttribute.cs
- HttpListenerResponse.cs
- ProcessStartInfo.cs
- CellLabel.cs
- QueryPageSettingsEventArgs.cs
- ListDataHelper.cs
- Thumb.cs
- StorageEntityTypeMapping.cs
- SmtpFailedRecipientsException.cs
- AutoResetEvent.cs
- LocalFileSettingsProvider.cs
- ArrangedElementCollection.cs
- ConnectionStringSettingsCollection.cs
- PartialClassGenerationTask.cs
- SortableBindingList.cs
- DummyDataSource.cs
- SrgsElementList.cs
- BridgeDataReader.cs
- NavigatorOutput.cs
- CultureInfoConverter.cs
- PathFigure.cs
- SecurityPolicySection.cs
- MetroSerializationManager.cs
- SiteMapNode.cs
- WebWorkflowRole.cs
- SchemaType.cs
- AssertUtility.cs
- NavigationProperty.cs
- SelfIssuedAuthProofToken.cs
- AdRotator.cs
- InvalidDataException.cs
- UriScheme.cs
- ellipse.cs
- DesignTimeParseData.cs
- SelectionChangedEventArgs.cs
- TrailingSpaceComparer.cs
- CacheDependency.cs
- ScriptModule.cs
- ShutDownListener.cs
- CodeSubDirectoriesCollection.cs
- NonVisualControlAttribute.cs
- TrackingExtract.cs
- CodeObjectCreateExpression.cs
- InArgument.cs
- CodeEntryPointMethod.cs
- ProcessThreadDesigner.cs
- ObjectHandle.cs
- BufferedReadStream.cs
- XmlAttributeCollection.cs
- CurrencyWrapper.cs