Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / FileDataSourceCache.cs / 1305376 / 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
- Item.cs
- HTMLTagNameToTypeMapper.cs
- DrawListViewColumnHeaderEventArgs.cs
- StructuralType.cs
- RuntimeWrappedException.cs
- GroupBox.cs
- ObfuscationAttribute.cs
- ContentDisposition.cs
- ProxyElement.cs
- TextFormatterHost.cs
- ToolboxControl.cs
- UserControlAutomationPeer.cs
- RangeValuePatternIdentifiers.cs
- XmlQueryRuntime.cs
- PassportAuthenticationModule.cs
- TextWriterTraceListener.cs
- Tracking.cs
- HwndSourceKeyboardInputSite.cs
- SelectingProviderEventArgs.cs
- DefaultTextStoreTextComposition.cs
- TimeSpanValidator.cs
- ISO2022Encoding.cs
- AccessDataSourceWizardForm.cs
- MetadataWorkspace.cs
- PropertyPathWorker.cs
- ImageSource.cs
- XmlNamespaceMapping.cs
- SqlCacheDependencySection.cs
- SessionSwitchEventArgs.cs
- SecuritySessionClientSettings.cs
- InputMethodStateTypeInfo.cs
- InheritanceContextHelper.cs
- Message.cs
- FileIOPermission.cs
- ParserOptions.cs
- RectAnimationClockResource.cs
- DbConnectionPoolCounters.cs
- SqlCommand.cs
- ApplySecurityAndSendAsyncResult.cs
- Util.cs
- FixedPage.cs
- PathGradientBrush.cs
- QilList.cs
- BaseParser.cs
- ImageMap.cs
- TouchesCapturedWithinProperty.cs
- xml.cs
- CompoundFileIOPermission.cs
- OdbcConnectionFactory.cs
- ChtmlTextWriter.cs
- CompilerGlobalScopeAttribute.cs
- LinearGradientBrush.cs
- formatstringdialog.cs
- FixedTextSelectionProcessor.cs
- WindowsRebar.cs
- HttpInputStream.cs
- AutoGeneratedFieldProperties.cs
- FontResourceCache.cs
- PeerPresenceInfo.cs
- DispatcherObject.cs
- RelationshipDetailsCollection.cs
- RowToParametersTransformer.cs
- DPCustomTypeDescriptor.cs
- DefaultBinder.cs
- JavaScriptSerializer.cs
- StreamWriter.cs
- XPathSelfQuery.cs
- Style.cs
- ProcessHostFactoryHelper.cs
- ControlOperationBehavior.cs
- SchemaSetCompiler.cs
- WorkItem.cs
- ConnectionStringsExpressionBuilder.cs
- NCryptSafeHandles.cs
- SettingsProperty.cs
- XmlSchemaInferenceException.cs
- TextEffect.cs
- SqlTriggerContext.cs
- DecoderExceptionFallback.cs
- TextEditor.cs
- SQLByte.cs
- SchemaMapping.cs
- QueryConverter.cs
- AmbientValueAttribute.cs
- ReadOnlyPropertyMetadata.cs
- ProgramNode.cs
- AdornerHitTestResult.cs
- ColorMap.cs
- DiscreteKeyFrames.cs
- ApplicationServiceHelper.cs
- MergeExecutor.cs
- ServiceOperationParameter.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SignatureSummaryDialog.cs
- ValidatorCollection.cs
- Int64AnimationUsingKeyFrames.cs
- WorkflowQueuingService.cs
- Schema.cs
- CollectionContainer.cs
- NamespaceInfo.cs