Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaSimpleTypeRestriction.cs
- ProfileProvider.cs
- XmlSchemaValidationException.cs
- BindingContext.cs
- EditorBrowsableAttribute.cs
- DataPointer.cs
- Int16Converter.cs
- Interfaces.cs
- HandlerBase.cs
- PageClientProxyGenerator.cs
- DataGridHeaderBorder.cs
- WeakEventManager.cs
- DocumentViewerAutomationPeer.cs
- UdpAnnouncementEndpoint.cs
- AutomationPropertyInfo.cs
- XmlReflectionMember.cs
- PersonalizationEntry.cs
- CultureInfo.cs
- PropertyBuilder.cs
- PriorityQueue.cs
- DocComment.cs
- DBCommand.cs
- Application.cs
- WindowsStatic.cs
- ClientRolePrincipal.cs
- SiteMapHierarchicalDataSourceView.cs
- X509Utils.cs
- RegexWorker.cs
- DragEvent.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ProxyElement.cs
- FormsAuthentication.cs
- ArrangedElement.cs
- BrowserCapabilitiesFactoryBase.cs
- FamilyCollection.cs
- HandoffBehavior.cs
- GCHandleCookieTable.cs
- TraceFilter.cs
- UnknownBitmapEncoder.cs
- CodeFieldReferenceExpression.cs
- BinaryKeyIdentifierClause.cs
- BooleanProjectedSlot.cs
- SafeUserTokenHandle.cs
- WsatEtwTraceListener.cs
- TextBoxRenderer.cs
- SetterBase.cs
- ToolStripArrowRenderEventArgs.cs
- NetworkAddressChange.cs
- TextDecoration.cs
- PerfCounters.cs
- FtpRequestCacheValidator.cs
- InstanceKeyNotReadyException.cs
- TcpTransportBindingElement.cs
- SchemaConstraints.cs
- CompoundFileStorageReference.cs
- SelectionProviderWrapper.cs
- TimeSpanParse.cs
- CodeGotoStatement.cs
- Visual3D.cs
- UIElementIsland.cs
- ElementUtil.cs
- FacetEnabledSchemaElement.cs
- SerialPinChanges.cs
- Stream.cs
- Accessible.cs
- ManualResetEvent.cs
- Debug.cs
- embossbitmapeffect.cs
- OperationCanceledException.cs
- StringFunctions.cs
- AppearanceEditorPart.cs
- KnowledgeBase.cs
- X509UI.cs
- WindowsScroll.cs
- SqlReorderer.cs
- X509Chain.cs
- DocumentViewerBaseAutomationPeer.cs
- KeyNotFoundException.cs
- DictionaryEntry.cs
- BoundField.cs
- FillBehavior.cs
- SendActivityEventArgs.cs
- _HTTPDateParse.cs
- COM2PropertyBuilderUITypeEditor.cs
- TextUtf8RawTextWriter.cs
- NaturalLanguageHyphenator.cs
- TabControlEvent.cs
- SymbolEqualComparer.cs
- CommonDialog.cs
- ExpressionBindings.cs
- CompositeCollectionView.cs
- ProtocolElementCollection.cs
- DesignerToolboxInfo.cs
- CustomValidator.cs
- SqlUserDefinedAggregateAttribute.cs
- HitTestFilterBehavior.cs
- SetMemberBinder.cs
- NativeWrapper.cs
- MethodCallConverter.cs
- DictionaryTraceRecord.cs