Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ExpanderAutomationPeer.cs
- XmlSchemaSimpleContentExtension.cs
- _DigestClient.cs
- DuplicateWaitObjectException.cs
- DeviceSpecificDialogCachedState.cs
- Quaternion.cs
- MobileListItemCollection.cs
- ParseNumbers.cs
- PingOptions.cs
- OLEDB_Enum.cs
- AccessControlList.cs
- WindowsAuthenticationModule.cs
- RootBuilder.cs
- ObjectStorage.cs
- WebScriptEndpointElement.cs
- SoapTypeAttribute.cs
- loginstatus.cs
- VirtualDirectoryMappingCollection.cs
- BasePattern.cs
- MDIClient.cs
- APCustomTypeDescriptor.cs
- _NativeSSPI.cs
- RegistrationContext.cs
- ListViewGroup.cs
- SqlDataReaderSmi.cs
- SessionStateUtil.cs
- DocumentAutomationPeer.cs
- FixedDocumentSequencePaginator.cs
- TlsSspiNegotiation.cs
- wmiprovider.cs
- ModelProperty.cs
- AuthenticationModuleElementCollection.cs
- DateBoldEvent.cs
- AttributeCollection.cs
- SpinLock.cs
- Helpers.cs
- InvalidEnumArgumentException.cs
- __TransparentProxy.cs
- base64Transforms.cs
- ThreadStaticAttribute.cs
- Int64KeyFrameCollection.cs
- MatrixTransform.cs
- GridEntry.cs
- HttpResponseInternalWrapper.cs
- DesignerActionKeyboardBehavior.cs
- MultipartIdentifier.cs
- PageStatePersister.cs
- ErasingStroke.cs
- RemoteCryptoTokenProvider.cs
- LinearKeyFrames.cs
- OleDbEnumerator.cs
- TextSelectionHelper.cs
- EventRouteFactory.cs
- MenuStrip.cs
- InvalidCommandTreeException.cs
- SynchronizedDispatch.cs
- TypeConverters.cs
- MasterPageParser.cs
- AmbientProperties.cs
- SoapProtocolReflector.cs
- DayRenderEvent.cs
- EventSetter.cs
- DataSourceControl.cs
- TextFormatter.cs
- HttpAsyncResult.cs
- CultureInfoConverter.cs
- DeploymentSectionCache.cs
- TableCellAutomationPeer.cs
- QueueProcessor.cs
- SaveFileDialog.cs
- UserControl.cs
- BinaryFormatterWriter.cs
- SimpleRecyclingCache.cs
- XmlRootAttribute.cs
- DateTimeOffsetStorage.cs
- PostBackOptions.cs
- IsolationInterop.cs
- DateTimeConstantAttribute.cs
- GroupBox.cs
- ISAPIWorkerRequest.cs
- RadioButton.cs
- BitmapFrameDecode.cs
- ImageBrush.cs
- FormsAuthenticationEventArgs.cs
- SequentialWorkflowHeaderFooter.cs
- COM2ExtendedTypeConverter.cs
- MaskedTextBoxTextEditor.cs
- TimeSpanSecondsConverter.cs
- BuildProvidersCompiler.cs
- UserCancellationException.cs
- CatalogZoneBase.cs
- HebrewCalendar.cs
- LayoutEngine.cs
- SiteMapHierarchicalDataSourceView.cs
- XPathNodeIterator.cs
- IgnoreSectionHandler.cs
- BezierSegment.cs
- VolatileEnlistmentMultiplexing.cs
- D3DImage.cs
- TargetControlTypeCache.cs