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
- CatalogPartDesigner.cs
- SqlCachedBuffer.cs
- TimeSpanStorage.cs
- LateBoundChannelParameterCollection.cs
- PlacementWorkspace.cs
- Light.cs
- PathBox.cs
- MultiPropertyDescriptorGridEntry.cs
- ResourcePermissionBaseEntry.cs
- AsymmetricAlgorithm.cs
- AnnotationMap.cs
- DataTemplateKey.cs
- SecurityTokenAuthenticator.cs
- SerializationException.cs
- Point3DCollection.cs
- ProfileEventArgs.cs
- ByteStack.cs
- SafeCloseHandleCritical.cs
- AspNetSynchronizationContext.cs
- RolePrincipal.cs
- StringValidator.cs
- iisPickupDirectory.cs
- SoapReflectionImporter.cs
- SmtpFailedRecipientException.cs
- PropertyManager.cs
- WebPartMinimizeVerb.cs
- ProfileEventArgs.cs
- ComboBoxItem.cs
- ViewBox.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DoubleCollectionValueSerializer.cs
- Knowncolors.cs
- SByte.cs
- TransactionValidationBehavior.cs
- DashStyle.cs
- Function.cs
- TransportConfigurationTypeElementCollection.cs
- CachedResourceDictionaryExtension.cs
- CanExecuteRoutedEventArgs.cs
- clipboard.cs
- FreezableDefaultValueFactory.cs
- WebPartDisplayModeCancelEventArgs.cs
- ZipIOFileItemStream.cs
- TextDecoration.cs
- ConfigurationSection.cs
- CorrelationManager.cs
- TextDecorations.cs
- OrderedDictionary.cs
- CqlLexerHelpers.cs
- ExpressionBindingCollection.cs
- MetaForeignKeyColumn.cs
- DelayDesigner.cs
- FrameworkElementAutomationPeer.cs
- Interlocked.cs
- ProxyDataContractResolver.cs
- DetailsView.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- CalendarBlackoutDatesCollection.cs
- RecoverInstanceLocksCommand.cs
- EventManager.cs
- CompositeDataBoundControl.cs
- PresentationSource.cs
- HasRunnableWorkflowEvent.cs
- ExplicitDiscriminatorMap.cs
- BaseTemplatedMobileComponentEditor.cs
- SystemFonts.cs
- ExpressionEditorAttribute.cs
- TcpConnectionPool.cs
- PackWebRequestFactory.cs
- SafeSecurityHelper.cs
- DataGridViewCellStateChangedEventArgs.cs
- AttributeProviderAttribute.cs
- ExpressionBuilder.cs
- LineBreak.cs
- TouchesOverProperty.cs
- Dictionary.cs
- SettingsSection.cs
- SqlNotificationRequest.cs
- UIPermission.cs
- GPStream.cs
- oledbmetadatacollectionnames.cs
- FieldDescriptor.cs
- WbmpConverter.cs
- Point3DAnimation.cs
- VoiceChangeEventArgs.cs
- InstanceData.cs
- InternalControlCollection.cs
- RealizationDrawingContextWalker.cs
- BulletedListEventArgs.cs
- Visual3D.cs
- AuditLevel.cs
- SerializationHelper.cs
- WebPartChrome.cs
- Bold.cs
- URLAttribute.cs
- CustomCredentialPolicy.cs
- TagPrefixAttribute.cs
- ConfigurationManagerInternal.cs
- CSharpCodeProvider.cs
- CompilerInfo.cs