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
- XmlSerializerNamespaces.cs
- SecurityPermission.cs
- XamlTypeMapper.cs
- X509Certificate2Collection.cs
- StaticSiteMapProvider.cs
- EventSinkActivity.cs
- GuidConverter.cs
- glyphs.cs
- WindowsSidIdentity.cs
- Assert.cs
- FragmentQueryKB.cs
- ExpanderAutomationPeer.cs
- HandlerFactoryWrapper.cs
- DbConnectionFactory.cs
- ComplexTypeEmitter.cs
- EdmComplexPropertyAttribute.cs
- ApplicationHost.cs
- ChannelSinkStacks.cs
- XpsDocumentEvent.cs
- PropertyValueUIItem.cs
- FunctionUpdateCommand.cs
- EntityConnection.cs
- PersistenceException.cs
- ServiceParser.cs
- ActivityInstanceReference.cs
- SimpleHandlerFactory.cs
- Automation.cs
- CssClassPropertyAttribute.cs
- cookiecollection.cs
- DialogWindow.cs
- TextFindEngine.cs
- HotCommands.cs
- documentsequencetextpointer.cs
- MtomMessageEncodingElement.cs
- UmAlQuraCalendar.cs
- PageAsyncTaskManager.cs
- SerializableReadOnlyDictionary.cs
- CreatingCookieEventArgs.cs
- SafeThreadHandle.cs
- XPathExpr.cs
- AttributeTable.cs
- datacache.cs
- GridViewDeletedEventArgs.cs
- DataListItemEventArgs.cs
- TimersDescriptionAttribute.cs
- _TLSstream.cs
- Reference.cs
- HashCryptoHandle.cs
- SmtpReplyReader.cs
- MimeTypePropertyAttribute.cs
- Debugger.cs
- ClientSideQueueItem.cs
- ListBindableAttribute.cs
- OrthographicCamera.cs
- SystemKeyConverter.cs
- DataGridTableCollection.cs
- XamlSerializerUtil.cs
- ClrProviderManifest.cs
- JoinGraph.cs
- Sentence.cs
- SecurityKeyEntropyMode.cs
- ListViewItem.cs
- WCFBuildProvider.cs
- CreateUserErrorEventArgs.cs
- XmlnsPrefixAttribute.cs
- TemplateBindingExtensionConverter.cs
- Int32Animation.cs
- AppDomainAttributes.cs
- QueueProcessor.cs
- TabControlEvent.cs
- ListViewEditEventArgs.cs
- CompilationUnit.cs
- Ipv6Element.cs
- RegisteredExpandoAttribute.cs
- DifferencingCollection.cs
- RectIndependentAnimationStorage.cs
- ObjectParameterCollection.cs
- DrawingAttributeSerializer.cs
- GridView.cs
- HMAC.cs
- StringPropertyBuilder.cs
- XamlStream.cs
- ClaimTypes.cs
- XmlBufferReader.cs
- RuleProcessor.cs
- IListConverters.cs
- XmlAnyElementAttribute.cs
- OrderedEnumerableRowCollection.cs
- EntityContainerEntitySetDefiningQuery.cs
- HotSpotCollection.cs
- SiteMapDataSource.cs
- SBCSCodePageEncoding.cs
- EmptyEnumerator.cs
- ResourcesGenerator.cs
- InternalConfigEventArgs.cs
- CustomAttributeFormatException.cs
- PolicyAssertionCollection.cs
- Atom10FeedFormatter.cs
- XmlHierarchyData.cs
- BatchStream.cs