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
- documentsequencetextview.cs
- InfoCardSymmetricAlgorithm.cs
- ExtensionDataReader.cs
- BitmapSourceSafeMILHandle.cs
- shaperfactory.cs
- PartialArray.cs
- HwndMouseInputProvider.cs
- BlurBitmapEffect.cs
- ConstraintEnumerator.cs
- WebPartVerbsEventArgs.cs
- FontInfo.cs
- EventBookmark.cs
- selecteditemcollection.cs
- XmlWrappingReader.cs
- ObjectItemCachedAssemblyLoader.cs
- Automation.cs
- Fx.cs
- CurrencyManager.cs
- PagerStyle.cs
- AggregateException.cs
- EntityDataSourceWizardForm.cs
- EncodingDataItem.cs
- XsdBuilder.cs
- OleStrCAMarshaler.cs
- VerificationException.cs
- RuleElement.cs
- ProviderCollection.cs
- AsyncResult.cs
- Transform.cs
- ClickablePoint.cs
- UIElement3DAutomationPeer.cs
- DragDeltaEventArgs.cs
- InputProviderSite.cs
- GridPattern.cs
- TimeZoneInfo.cs
- TemplateColumn.cs
- SectionVisual.cs
- BlockCollection.cs
- ProxyManager.cs
- KeyedCollection.cs
- Buffer.cs
- ZipIOLocalFileDataDescriptor.cs
- ViewManager.cs
- OnOperation.cs
- OAVariantLib.cs
- XomlCompilerError.cs
- EdgeProfileValidation.cs
- AdjustableArrowCap.cs
- CopyNamespacesAction.cs
- SchemaObjectWriter.cs
- ExpressionBuilder.cs
- PageMediaType.cs
- FontSourceCollection.cs
- ThumbButtonInfoCollection.cs
- ExpressionBinding.cs
- BaseHashHelper.cs
- FileIOPermission.cs
- RegexReplacement.cs
- CounterSampleCalculator.cs
- FrameworkElementFactory.cs
- FixedSOMImage.cs
- BaseTreeIterator.cs
- Vector3dCollection.cs
- DbParameterCollectionHelper.cs
- InheritanceAttribute.cs
- RecordConverter.cs
- ProcessingInstructionAction.cs
- RoleManagerEventArgs.cs
- MaskedTextBoxDesignerActionList.cs
- RepeaterItemEventArgs.cs
- EntityTemplateUserControl.cs
- VariableQuery.cs
- AppSettingsSection.cs
- SchemaNamespaceManager.cs
- SEHException.cs
- SubpageParaClient.cs
- EnvelopeVersion.cs
- DataQuery.cs
- DataSourceControlBuilder.cs
- ZipArchive.cs
- SignedXml.cs
- XmlException.cs
- Int16AnimationUsingKeyFrames.cs
- FontInfo.cs
- DateTimeConstantAttribute.cs
- String.cs
- ElementProxy.cs
- Helpers.cs
- SHA512Managed.cs
- ColorConverter.cs
- SafeHandle.cs
- DiscoveryClientReferences.cs
- PiiTraceSource.cs
- SqlFactory.cs
- SelectorItemAutomationPeer.cs
- BridgeDataReader.cs
- WeakEventTable.cs
- SchemaType.cs
- Number.cs
- BlurBitmapEffect.cs