Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MonthCalendar.cs
- CollectionViewProxy.cs
- DtcInterfaces.cs
- MultiDataTrigger.cs
- autovalidator.cs
- HtmlTableCell.cs
- Storyboard.cs
- HttpVersion.cs
- GeneralTransform2DTo3DTo2D.cs
- SystemNetHelpers.cs
- ServicePoint.cs
- ListBoxItem.cs
- Package.cs
- ScrollBarAutomationPeer.cs
- GcSettings.cs
- Config.cs
- TextElement.cs
- ListItem.cs
- InteropAutomationProvider.cs
- COAUTHIDENTITY.cs
- ToolStripPanelDesigner.cs
- ReadWriteSpinLock.cs
- StandardOleMarshalObject.cs
- ScriptIgnoreAttribute.cs
- ProxyFragment.cs
- ParseHttpDate.cs
- TransportSecurityHelpers.cs
- Shared.cs
- ContractMapping.cs
- EncoderFallback.cs
- Control.cs
- ClientApiGenerator.cs
- AttributeCollection.cs
- WebPartUtil.cs
- DetailsViewRowCollection.cs
- IntegrationExceptionEventArgs.cs
- IdentityValidationException.cs
- KeyInstance.cs
- DefaultBinder.cs
- TypeDescriptionProviderAttribute.cs
- ImageMap.cs
- ConfigXmlText.cs
- FrugalMap.cs
- VoiceSynthesis.cs
- XmlDataSource.cs
- DES.cs
- PathGeometry.cs
- XmlDocumentFieldSchema.cs
- ContentPosition.cs
- SoapTypeAttribute.cs
- UriSectionData.cs
- WorkflowViewElement.cs
- SoapTypeAttribute.cs
- EdmFunction.cs
- RoleProviderPrincipal.cs
- DateTimeConstantAttribute.cs
- ValidationError.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- SQLDoubleStorage.cs
- Config.cs
- NotifyIcon.cs
- DataSourceXmlSubItemAttribute.cs
- AttributeProviderAttribute.cs
- EventDescriptorCollection.cs
- DelayedRegex.cs
- RequestQueue.cs
- Selection.cs
- CryptoApi.cs
- SiteMapNode.cs
- ChtmlTextWriter.cs
- ConstructorBuilder.cs
- HtmlTableRowCollection.cs
- AndCondition.cs
- CodeCatchClause.cs
- SqlXmlStorage.cs
- CompositeControl.cs
- SafeLocalMemHandle.cs
- RefreshEventArgs.cs
- UserControlParser.cs
- TextFormatter.cs
- KeyValuePair.cs
- ExceptionHandler.cs
- SystemResources.cs
- StateBag.cs
- SqlTopReducer.cs
- TextRangeProviderWrapper.cs
- PassportAuthentication.cs
- TextEditorCharacters.cs
- COM2PropertyDescriptor.cs
- VirtualizingPanel.cs
- CommandBinding.cs
- InOutArgument.cs
- FixedTextContainer.cs
- AesCryptoServiceProvider.cs
- OdbcErrorCollection.cs
- AuthenticatedStream.cs
- BitmapEffectGroup.cs
- InstanceDataCollection.cs
- QilTypeChecker.cs
- PageCatalogPart.cs