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
- ClusterRegistryConfigurationProvider.cs
- DoubleCollectionConverter.cs
- SoapIgnoreAttribute.cs
- XappLauncher.cs
- DurableRuntimeValidator.cs
- ObjectAnimationBase.cs
- NetworkInterface.cs
- QilFactory.cs
- TextEncodedRawTextWriter.cs
- updatecommandorderer.cs
- RelationshipType.cs
- SystemNetworkInterface.cs
- BookmarkEventArgs.cs
- XPathItem.cs
- BadImageFormatException.cs
- Soap.cs
- UnsafeNativeMethods.cs
- SspiHelper.cs
- _FixedSizeReader.cs
- FileDialog_Vista.cs
- WorkerRequest.cs
- TabletCollection.cs
- PickDesigner.xaml.cs
- ProfessionalColors.cs
- XmlSchemaType.cs
- ToolBarButton.cs
- IndexingContentUnit.cs
- MutexSecurity.cs
- ArgumentReference.cs
- LZCodec.cs
- RoutingService.cs
- DatatypeImplementation.cs
- AssemblyHelper.cs
- PagerSettings.cs
- ExtendedProperty.cs
- TraceSwitch.cs
- WebResourceUtil.cs
- EntityDataSourceMemberPath.cs
- TrackingProfile.cs
- Label.cs
- OleDbParameterCollection.cs
- HttpServerUtilityWrapper.cs
- WebBrowserContainer.cs
- WriteStateInfoBase.cs
- SignedXml.cs
- TimeZone.cs
- DataGridViewSelectedRowCollection.cs
- ListItemConverter.cs
- FrameworkObject.cs
- PhysicalFontFamily.cs
- _WinHttpWebProxyDataBuilder.cs
- ServiceOperationViewControl.cs
- FileAuthorizationModule.cs
- DataGridItemAutomationPeer.cs
- Assembly.cs
- CodeGeneratorOptions.cs
- XmlQueryStaticData.cs
- DependencyPropertyAttribute.cs
- SiteMapProvider.cs
- CodeDirectiveCollection.cs
- XsltContext.cs
- SizeAnimation.cs
- DataTableReaderListener.cs
- ApplicationFileCodeDomTreeGenerator.cs
- CellCreator.cs
- UserPreferenceChangingEventArgs.cs
- Invariant.cs
- CustomAttributeBuilder.cs
- WebPartAuthorizationEventArgs.cs
- Pen.cs
- ConfigXmlAttribute.cs
- PnrpPermission.cs
- ProvidePropertyAttribute.cs
- ImageCodecInfo.cs
- DataGridViewColumnConverter.cs
- SourceLineInfo.cs
- RoleManagerEventArgs.cs
- EntityDataSourceDesigner.cs
- ListControl.cs
- LogPolicy.cs
- BinaryQueryOperator.cs
- IDictionary.cs
- CodeGenerator.cs
- IPipelineRuntime.cs
- DebugView.cs
- XmlC14NWriter.cs
- ConstructorNeedsTagAttribute.cs
- _ConnectOverlappedAsyncResult.cs
- InputLangChangeEvent.cs
- LicenseException.cs
- LambdaCompiler.cs
- XsltConvert.cs
- DiffuseMaterial.cs
- CultureMapper.cs
- WebBrowserEvent.cs
- Transform.cs
- TableAutomationPeer.cs
- DesignerLoader.cs
- WorkflowStateRollbackService.cs
- IndexedGlyphRun.cs