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
- ErrorStyle.cs
- ProcessThreadCollection.cs
- StorageMappingItemCollection.cs
- BaseHashHelper.cs
- CurrentTimeZone.cs
- SmiRecordBuffer.cs
- ScalarType.cs
- RequestCacheEntry.cs
- ColorDialog.cs
- MailAddressParser.cs
- GenericRootAutomationPeer.cs
- _FixedSizeReader.cs
- XmlSignatureProperties.cs
- TypeConverter.cs
- JsonFormatWriterGenerator.cs
- ActivityInstanceReference.cs
- SmiContextFactory.cs
- RewritingPass.cs
- ResourceProperty.cs
- FontCacheUtil.cs
- HttpDebugHandler.cs
- ModelTreeEnumerator.cs
- DataBoundLiteralControl.cs
- ClrProviderManifest.cs
- SafeCryptoHandles.cs
- FileSystemEventArgs.cs
- SqlRemoveConstantOrderBy.cs
- XmlSchemaIdentityConstraint.cs
- ListView.cs
- SessionViewState.cs
- DescendantQuery.cs
- StickyNoteAnnotations.cs
- OleDbSchemaGuid.cs
- RemotingHelper.cs
- CellIdBoolean.cs
- DatePickerTextBox.cs
- DeleteIndexBinder.cs
- TableColumnCollectionInternal.cs
- ChangeProcessor.cs
- FileClassifier.cs
- IxmlLineInfo.cs
- RemoteHelper.cs
- InputDevice.cs
- ContentElement.cs
- Stack.cs
- WindowCollection.cs
- DbExpressionRules.cs
- Rfc2898DeriveBytes.cs
- SapiRecoContext.cs
- storepermissionattribute.cs
- ExceptionUtil.cs
- RestHandlerFactory.cs
- Parameter.cs
- ConfigurationStrings.cs
- UnmanagedMarshal.cs
- DoubleLink.cs
- InvalidateEvent.cs
- ASCIIEncoding.cs
- OpenTypeCommon.cs
- ReadWriteObjectLock.cs
- TextClipboardData.cs
- SqlClientWrapperSmiStream.cs
- NamespaceImport.cs
- UxThemeWrapper.cs
- Helper.cs
- SqlServer2KCompatibilityCheck.cs
- ArraySubsetEnumerator.cs
- ConfigurationLocationCollection.cs
- XamlTypeMapper.cs
- coordinator.cs
- DataObjectAttribute.cs
- MailBnfHelper.cs
- AsyncOperationContext.cs
- SettingsBase.cs
- UrlMappingsSection.cs
- XmlFormatExtensionAttribute.cs
- OdbcConnectionFactory.cs
- SystemNetHelpers.cs
- DriveNotFoundException.cs
- StyleTypedPropertyAttribute.cs
- ScriptingRoleServiceSection.cs
- LicenseProviderAttribute.cs
- KoreanLunisolarCalendar.cs
- LayoutEvent.cs
- FlowDocumentPage.cs
- WebPermission.cs
- GridToolTip.cs
- XhtmlBasicCalendarAdapter.cs
- ParserOptions.cs
- Metadata.cs
- SharedStatics.cs
- MsmqChannelFactoryBase.cs
- Compress.cs
- ColorConvertedBitmapExtension.cs
- UnsafeNativeMethods.cs
- ParseHttpDate.cs
- Identity.cs
- InputLanguageEventArgs.cs
- DataSourceHelper.cs
- XmlUrlEditor.cs