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
- DragEvent.cs
- ColorConvertedBitmap.cs
- SqlDataSourceSelectingEventArgs.cs
- Buffer.cs
- Resources.Designer.cs
- ApplicationFileParser.cs
- StringArrayConverter.cs
- XmlAnyAttributeAttribute.cs
- BufferedGraphicsManager.cs
- BuildResult.cs
- WebRequestModuleElement.cs
- oledbmetadatacollectionnames.cs
- AmbientLight.cs
- Point3DKeyFrameCollection.cs
- StateChangeEvent.cs
- SByte.cs
- SafeRegistryHandle.cs
- UndoUnit.cs
- TemplateDefinition.cs
- BeginStoryboard.cs
- TransportManager.cs
- LineBreak.cs
- TriState.cs
- SecurityElement.cs
- File.cs
- OutputCacheModule.cs
- Parser.cs
- DiagnosticTraceSource.cs
- ClientRuntimeConfig.cs
- TextCharacters.cs
- Helpers.cs
- _RegBlobWebProxyDataBuilder.cs
- PropertyGroupDescription.cs
- TableCellCollection.cs
- BinaryObjectWriter.cs
- StylusPointDescription.cs
- ConnectivityStatus.cs
- SpeakProgressEventArgs.cs
- TemplateColumn.cs
- GridViewSelectEventArgs.cs
- RichTextBoxConstants.cs
- VirtualPathProvider.cs
- DelegateBodyWriter.cs
- ResourceManagerWrapper.cs
- SiteMapHierarchicalDataSourceView.cs
- AttributeCollection.cs
- Soap12ServerProtocol.cs
- MenuItem.cs
- DataGridTableCollection.cs
- OleCmdHelper.cs
- ObjectContext.cs
- GeneralTransform3DTo2D.cs
- BindingNavigator.cs
- DocumentOrderQuery.cs
- StorageAssociationSetMapping.cs
- WindowsRebar.cs
- CSharpCodeProvider.cs
- Constant.cs
- ServerProtocol.cs
- WeakReferenceEnumerator.cs
- BamlLocalizationDictionary.cs
- MenuItemStyleCollectionEditor.cs
- HostingEnvironmentException.cs
- CredentialCache.cs
- DecoderFallback.cs
- ToolStripDropDownButton.cs
- DockProviderWrapper.cs
- BooleanConverter.cs
- ContextMenuStripGroup.cs
- httpapplicationstate.cs
- RowSpanVector.cs
- SafeMILHandle.cs
- BinaryObjectInfo.cs
- TypeDescriptor.cs
- PropertyInformationCollection.cs
- BindUriHelper.cs
- ResourceProperty.cs
- BinaryCommonClasses.cs
- MultiSelectRootGridEntry.cs
- Stylesheet.cs
- AppManager.cs
- CachedPathData.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SocketAddress.cs
- InternalDispatchObject.cs
- PerformanceCounterManager.cs
- XPathMultyIterator.cs
- DocumentViewer.cs
- SQLGuid.cs
- FlowDocumentFormatter.cs
- MappingSource.cs
- ObjectSecurityT.cs
- WebControl.cs
- ToolStripSeparatorRenderEventArgs.cs
- SingleResultAttribute.cs
- GroupItem.cs
- AppDomain.cs
- WorkflowPrinting.cs
- HttpApplication.cs
- ObjectFactoryCodeDomTreeGenerator.cs