Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- RequestNavigateEventArgs.cs
- DataGridViewCellStyleConverter.cs
- UTF8Encoding.cs
- ColorTranslator.cs
- IODescriptionAttribute.cs
- XmlProcessingInstruction.cs
- CommonDialog.cs
- RequestTimeoutManager.cs
- ColorTransform.cs
- FlowDocumentView.cs
- ListViewItemSelectionChangedEvent.cs
- ToggleButton.cs
- Comparer.cs
- ToolStripTextBox.cs
- SelectionRange.cs
- ConnectionStringsExpressionBuilder.cs
- HttpListenerRequest.cs
- AvTraceFormat.cs
- SafeNativeMethodsCLR.cs
- SecurityState.cs
- DataGridViewAdvancedBorderStyle.cs
- HostProtectionException.cs
- ServerIdentity.cs
- Point.cs
- DisplayMemberTemplateSelector.cs
- Missing.cs
- ItemCollectionEditor.cs
- TypeLibConverter.cs
- X509Certificate2Collection.cs
- DataTableCollection.cs
- InlineUIContainer.cs
- ComplexPropertyEntry.cs
- PenCursorManager.cs
- CqlParserHelpers.cs
- SignatureHelper.cs
- PolyLineSegmentFigureLogic.cs
- ItemCheckEvent.cs
- GenericArgumentsUpdater.cs
- InkSerializer.cs
- SqlUnionizer.cs
- HtmlAnchor.cs
- PerformanceCounterPermissionAttribute.cs
- NativeMethods.cs
- ListViewItemEventArgs.cs
- HttpWriter.cs
- HttpMethodConstraint.cs
- UnknownWrapper.cs
- DBSqlParserColumn.cs
- SafeUserTokenHandle.cs
- BitConverter.cs
- ListViewItem.cs
- NTAccount.cs
- IntellisenseTextBox.cs
- webbrowsersite.cs
- RelatedEnd.cs
- RTLAwareMessageBox.cs
- ObjectComplexPropertyMapping.cs
- _Connection.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- TransformConverter.cs
- HttpResponseHeader.cs
- DefaultBindingPropertyAttribute.cs
- SmiRequestExecutor.cs
- RequestTimeoutManager.cs
- XmlUrlResolver.cs
- QilExpression.cs
- InfoCardUIAgent.cs
- UnmanagedMemoryStream.cs
- FixedSOMPageElement.cs
- DisableDpiAwarenessAttribute.cs
- CommandValueSerializer.cs
- xamlnodes.cs
- SearchForVirtualItemEventArgs.cs
- ManagementObjectCollection.cs
- TraceSection.cs
- XmlSchemaAnyAttribute.cs
- FileDialogCustomPlace.cs
- TrustLevelCollection.cs
- FamilyMap.cs
- SystemWebExtensionsSectionGroup.cs
- LoadWorkflowByKeyAsyncResult.cs
- UIPermission.cs
- StateItem.cs
- AuthorizationContext.cs
- DeferredElementTreeState.cs
- TreeNodeConverter.cs
- ReaderWriterLock.cs
- ValidatingPropertiesEventArgs.cs
- HostedTransportConfigurationBase.cs
- FontClient.cs
- Tile.cs
- ConnectionDemuxer.cs
- EndCreateSecurityTokenRequest.cs
- StructuredProperty.cs
- WindowClosedEventArgs.cs
- GetPageCompletedEventArgs.cs
- SqlConnectionString.cs
- SqlUserDefinedAggregateAttribute.cs
- RowBinding.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs