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
- UserPreferenceChangingEventArgs.cs
- BinaryNode.cs
- EntityDataSourceState.cs
- Solver.cs
- MsmqIntegrationMessageProperty.cs
- FilterException.cs
- Filter.cs
- SortExpressionBuilder.cs
- FormatConvertedBitmap.cs
- BuildDependencySet.cs
- WebBrowsableAttribute.cs
- Composition.cs
- NullReferenceException.cs
- SqlTriggerContext.cs
- ObjectViewEntityCollectionData.cs
- Decimal.cs
- Oid.cs
- ZipArchive.cs
- SafeNativeMethods.cs
- ListViewSelectEventArgs.cs
- AudioStateChangedEventArgs.cs
- GenericTextProperties.cs
- ToolStripDropDownItem.cs
- InputLanguageCollection.cs
- XmlMemberMapping.cs
- EntityReference.cs
- ParallelSeparator.xaml.cs
- ObjectListGeneralPage.cs
- DbProviderFactory.cs
- Avt.cs
- DataGridItemAutomationPeer.cs
- WebFaultClientMessageInspector.cs
- ContentType.cs
- StringAttributeCollection.cs
- BitmapFrame.cs
- InputLanguageProfileNotifySink.cs
- ProgressBarBrushConverter.cs
- RelatedImageListAttribute.cs
- ImagingCache.cs
- Mapping.cs
- PersistenceContextEnlistment.cs
- PackageRelationship.cs
- ILGenerator.cs
- PKCS1MaskGenerationMethod.cs
- TTSVoice.cs
- ToolStripContentPanel.cs
- HtmlInputPassword.cs
- EmptyQuery.cs
- CompareValidator.cs
- _NativeSSPI.cs
- TreeNodeMouseHoverEvent.cs
- State.cs
- Utils.cs
- UIElementAutomationPeer.cs
- Stylesheet.cs
- ElasticEase.cs
- RoutedPropertyChangedEventArgs.cs
- ParameterElementCollection.cs
- TypeDescriptionProviderAttribute.cs
- BaseTemplateBuildProvider.cs
- DocumentViewerAutomationPeer.cs
- PersonalizationStateInfoCollection.cs
- HtmlPhoneCallAdapter.cs
- StringKeyFrameCollection.cs
- TextEditorCopyPaste.cs
- SqlXmlStorage.cs
- StreamInfo.cs
- PartManifestEntry.cs
- BasicBrowserDialog.cs
- EdgeProfileValidation.cs
- UmAlQuraCalendar.cs
- RoleService.cs
- BrowserCapabilitiesCompiler.cs
- ExtensibleClassFactory.cs
- SystemThemeKey.cs
- ExpandedWrapper.cs
- Profiler.cs
- _ListenerAsyncResult.cs
- JapaneseLunisolarCalendar.cs
- GenericEnumerator.cs
- CngKeyBlobFormat.cs
- HandlerBase.cs
- ScopelessEnumAttribute.cs
- ISAPIWorkerRequest.cs
- X509LogoTypeExtension.cs
- HTMLTagNameToTypeMapper.cs
- AsyncResult.cs
- InternalDispatchObject.cs
- Number.cs
- EncryptionUtility.cs
- ToolBarTray.cs
- EntityDesignerDataSourceView.cs
- CommonRemoteMemoryBlock.cs
- ResolveCriteriaApril2005.cs
- DocumentPageViewAutomationPeer.cs
- CatalogPartCollection.cs
- PathHelper.cs
- EntityContainerEmitter.cs
- ReceiveMessageRecord.cs
- DataGridTable.cs