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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HtmlInputText.cs
- ChannelBase.cs
- ReadOnlyDictionary.cs
- ShaperBuffers.cs
- DataServiceQueryException.cs
- SnapshotChangeTrackingStrategy.cs
- MenuItemBinding.cs
- ClickablePoint.cs
- WebHostScriptMappingsInstallComponent.cs
- InputBindingCollection.cs
- EntityDataSourceView.cs
- TransactionException.cs
- ExpressionPrefixAttribute.cs
- BitmapSource.cs
- propertytag.cs
- COM2FontConverter.cs
- CancellationTokenSource.cs
- COAUTHINFO.cs
- FillErrorEventArgs.cs
- XmlReflectionImporter.cs
- GridViewCommandEventArgs.cs
- UnmanagedBitmapWrapper.cs
- PreviewPageInfo.cs
- ITextView.cs
- PasswordDeriveBytes.cs
- InternalCache.cs
- DBPropSet.cs
- ToolStripPanelCell.cs
- PreDigestedSignedInfo.cs
- FontFamily.cs
- TextParentUndoUnit.cs
- SubpageParaClient.cs
- ObfuscateAssemblyAttribute.cs
- ThreadStateException.cs
- Size3D.cs
- CounterCreationData.cs
- LongTypeConverter.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- TypedReference.cs
- FontWeightConverter.cs
- TrackBar.cs
- WindowsGraphics2.cs
- Debugger.cs
- UserPersonalizationStateInfo.cs
- RoutedCommand.cs
- SmiTypedGetterSetter.cs
- SiblingIterators.cs
- EventlogProvider.cs
- thaishape.cs
- ConfigsHelper.cs
- HttpResponse.cs
- PropertyChangedEventManager.cs
- HttpBrowserCapabilitiesWrapper.cs
- XmlLanguageConverter.cs
- IndentedWriter.cs
- MonthChangedEventArgs.cs
- HttpModulesSection.cs
- PipelineComponent.cs
- HotCommands.cs
- RemoteWebConfigurationHost.cs
- DLinqColumnProvider.cs
- HostExecutionContextManager.cs
- CacheChildrenQuery.cs
- Main.cs
- CodeGenerator.cs
- ContextBase.cs
- TypeRestriction.cs
- XamlFigureLengthSerializer.cs
- RSACryptoServiceProvider.cs
- DefinitionUpdate.cs
- SmiTypedGetterSetter.cs
- ApplicationId.cs
- ParameterToken.cs
- UxThemeWrapper.cs
- CryptoSession.cs
- Typography.cs
- PersistChildrenAttribute.cs
- ReaderWriterLock.cs
- Dictionary.cs
- SplashScreenNativeMethods.cs
- HttpContextServiceHost.cs
- CompositionDesigner.cs
- DesignerVerb.cs
- DbConnectionPoolGroup.cs
- LocatorPartList.cs
- TemplateEditingService.cs
- ObjectCache.cs
- TextRangeAdaptor.cs
- While.cs
- RelationshipEndMember.cs
- BindingExpressionUncommonField.cs
- SafeEventLogReadHandle.cs
- CatalogPart.cs
- StringAnimationBase.cs
- GCHandleCookieTable.cs
- IsolationInterop.cs
- Function.cs
- WizardPanelChangingEventArgs.cs
- FormatterServicesNoSerializableCheck.cs
- Compiler.cs