Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Mappings.cs
- TemplateInstanceAttribute.cs
- ListViewCommandEventArgs.cs
- FunctionDetailsReader.cs
- TextWriter.cs
- DynamicArgumentDialog.cs
- Parser.cs
- EventProvider.cs
- UIServiceHelper.cs
- DialogResultConverter.cs
- SqlDataSourceView.cs
- DataKeyArray.cs
- SortedList.cs
- ExpandSegment.cs
- DataGridViewColumnHeaderCell.cs
- StreamInfo.cs
- DockPanel.cs
- OleDbException.cs
- TcpActivation.cs
- PeerApplication.cs
- SqlRemoveConstantOrderBy.cs
- MergeLocalizationDirectives.cs
- DataGridViewTextBoxEditingControl.cs
- Transform.cs
- AsyncPostBackTrigger.cs
- PlaceHolder.cs
- UnmanagedMemoryStreamWrapper.cs
- CodeTypeParameter.cs
- ContractComponent.cs
- RtfControlWordInfo.cs
- CreateUserWizardAutoFormat.cs
- SqlDataSourceCommandEventArgs.cs
- SqlStatistics.cs
- XmlUnspecifiedAttribute.cs
- TileBrush.cs
- SmtpReplyReader.cs
- EntityDataSourceViewSchema.cs
- MenuBase.cs
- SerialErrors.cs
- StylusPlugInCollection.cs
- SynchronizedDispatch.cs
- SiteMapPathDesigner.cs
- Compilation.cs
- FormViewInsertedEventArgs.cs
- HtmlElementErrorEventArgs.cs
- SignerInfo.cs
- XmlObjectSerializer.cs
- MDIClient.cs
- TableLayoutColumnStyleCollection.cs
- ComponentChangedEvent.cs
- PrefixHandle.cs
- SystemFonts.cs
- LinqMaximalSubtreeNominator.cs
- TextEditor.cs
- InstanceCreationEditor.cs
- WebServiceData.cs
- DataGridItemCollection.cs
- XmlSchemaComplexContentExtension.cs
- DBBindings.cs
- LoggedException.cs
- GetPageNumberCompletedEventArgs.cs
- CollectionBuilder.cs
- XmlChildEnumerator.cs
- TextPointer.cs
- OdbcHandle.cs
- StandardToolWindows.cs
- XmlConvert.cs
- WebDisplayNameAttribute.cs
- WebBrowserHelper.cs
- DllNotFoundException.cs
- ObjectSpanRewriter.cs
- DataGridViewLinkColumn.cs
- DataServiceQueryOfT.cs
- NullableBoolConverter.cs
- ContextProperty.cs
- SoapElementAttribute.cs
- MDIClient.cs
- WmlObjectListAdapter.cs
- XslNumber.cs
- EmptyCollection.cs
- PagesSection.cs
- remotingproxy.cs
- UInt16Storage.cs
- GradientBrush.cs
- ObjectComplexPropertyMapping.cs
- ZipPackage.cs
- VerificationAttribute.cs
- OracleParameter.cs
- ThemeDictionaryExtension.cs
- UserControl.cs
- SHA384.cs
- ToolboxCategoryItems.cs
- SQLBytes.cs
- TrackingProvider.cs
- ColorConverter.cs
- Memoizer.cs
- SoapAttributeOverrides.cs
- XXXOnTypeBuilderInstantiation.cs
- BinaryParser.cs
- LineInfo.cs