Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColorAnimationBase.cs
- ConfigErrorGlyph.cs
- CompatibleIComparer.cs
- RoutedEventValueSerializer.cs
- FixedFlowMap.cs
- ColorConverter.cs
- ValueTypePropertyReference.cs
- Schema.cs
- MultiPageTextView.cs
- RuntimeArgumentHandle.cs
- ContentPathSegment.cs
- Rect3DValueSerializer.cs
- ErrorEventArgs.cs
- Block.cs
- Msec.cs
- ForeignKeyConstraint.cs
- HtmlHistory.cs
- MultiByteCodec.cs
- DynamicILGenerator.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- PersistenceProviderElement.cs
- DbConnectionPoolIdentity.cs
- SyndicationItem.cs
- HtmlInputReset.cs
- OracleDataAdapter.cs
- SingleConverter.cs
- BufferAllocator.cs
- StateWorkerRequest.cs
- WizardStepBase.cs
- ProviderMetadataCachedInformation.cs
- ListenerElementsCollection.cs
- SmiConnection.cs
- SessionEndingCancelEventArgs.cs
- OutputCacheSettingsSection.cs
- DataControlCommands.cs
- GlyphRunDrawing.cs
- TraceXPathNavigator.cs
- XmlSchemaChoice.cs
- DateTimeEditor.cs
- SocketPermission.cs
- MailAddress.cs
- SqlDependencyListener.cs
- TypeForwardedToAttribute.cs
- BamlTreeUpdater.cs
- FontWeightConverter.cs
- CSharpCodeProvider.cs
- HttpWebResponse.cs
- ExpressionPrefixAttribute.cs
- GridViewEditEventArgs.cs
- TableCell.cs
- SerialStream.cs
- _NestedSingleAsyncResult.cs
- ContentTypeSettingClientMessageFormatter.cs
- CopyNamespacesAction.cs
- PersonalizationProviderCollection.cs
- WebServiceClientProxyGenerator.cs
- WebServiceFault.cs
- WebPartEditorOkVerb.cs
- DataComponentNameHandler.cs
- WorkflowViewElement.cs
- ComplexPropertyEntry.cs
- IsolatedStorage.cs
- UsernameTokenFactoryCredential.cs
- EnumConverter.cs
- InputScopeNameConverter.cs
- ParserContext.cs
- SelectionPatternIdentifiers.cs
- COM2EnumConverter.cs
- PointCollectionConverter.cs
- X509Certificate2Collection.cs
- X509ThumbprintKeyIdentifierClause.cs
- StandardToolWindows.cs
- AssemblyNameProxy.cs
- IncrementalHitTester.cs
- DataGridViewTopLeftHeaderCell.cs
- TextTreeExtractElementUndoUnit.cs
- NTAccount.cs
- DataReaderContainer.cs
- Bold.cs
- MsmqOutputMessage.cs
- Viewport3DVisual.cs
- TextFormatter.cs
- PreloadHost.cs
- EntityDataSourceDataSelectionPanel.cs
- FixedPageAutomationPeer.cs
- ChineseLunisolarCalendar.cs
- LocationSectionRecord.cs
- TransformCollection.cs
- XmlSchemaComplexContentRestriction.cs
- Model3D.cs
- DataGridViewCell.cs
- TraceInternal.cs
- WizardStepBase.cs
- Floater.cs
- RuntimeConfigurationRecord.cs
- BitmapEffectDrawingContent.cs
- SingleConverter.cs
- HttpClientCertificate.cs
- StrongNameUtility.cs
- SessionStateUtil.cs