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
- ReflectionPermission.cs
- ScriptResourceInfo.cs
- MimeMultiPart.cs
- PageParserFilter.cs
- WindowPattern.cs
- FilterQueryOptionExpression.cs
- HtmlTableCellCollection.cs
- FormViewPageEventArgs.cs
- ObjectKeyFrameCollection.cs
- TrackingProfileSerializer.cs
- XmlArrayAttribute.cs
- IPAddress.cs
- HwndKeyboardInputProvider.cs
- RecommendedAsConfigurableAttribute.cs
- TranslateTransform.cs
- RepeaterItemCollection.cs
- MultipleViewPattern.cs
- SessionViewState.cs
- ResolveCriteria11.cs
- WebPartCatalogCloseVerb.cs
- WeakHashtable.cs
- ZipIOFileItemStream.cs
- RegexCompilationInfo.cs
- XomlCompilerError.cs
- Parser.cs
- TextFormatterContext.cs
- SizeIndependentAnimationStorage.cs
- BackgroundFormatInfo.cs
- AudienceUriMode.cs
- MulticastNotSupportedException.cs
- ParameterBuilder.cs
- TimeoutValidationAttribute.cs
- Pkcs7Signer.cs
- ImageMetadata.cs
- BoolExpressionVisitors.cs
- BatchServiceHost.cs
- TextRangeBase.cs
- MethodImplAttribute.cs
- XPathExpr.cs
- XhtmlBasicControlAdapter.cs
- XmlAtomicValue.cs
- BindingEntityInfo.cs
- ReflectTypeDescriptionProvider.cs
- FactoryGenerator.cs
- ByeMessage11.cs
- SafeCryptContextHandle.cs
- QueryAccessibilityHelpEvent.cs
- Profiler.cs
- DefinitionProperties.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- ApplicationSecurityInfo.cs
- Cloud.cs
- StylusPointProperties.cs
- SqlBuilder.cs
- MetadataPropertyvalue.cs
- ContentHostHelper.cs
- TrackingConditionCollection.cs
- AttachedAnnotation.cs
- FastEncoderWindow.cs
- X509ScopedServiceCertificateElement.cs
- SecurityTokenProvider.cs
- MDIControlStrip.cs
- MasterPageParser.cs
- AuthenticatedStream.cs
- SystemMulticastIPAddressInformation.cs
- EventPropertyMap.cs
- Marshal.cs
- PolyLineSegment.cs
- StrokeNodeOperations.cs
- safemediahandle.cs
- DockProviderWrapper.cs
- SimpleHandlerFactory.cs
- ContentHostHelper.cs
- DesignerSelectionListAdapter.cs
- BitmapEffectGroup.cs
- SchemaMerger.cs
- Thread.cs
- WebPartConnectionsCloseVerb.cs
- ControlParameter.cs
- XappLauncher.cs
- TreeViewEvent.cs
- RequiredAttributeAttribute.cs
- SafeHandle.cs
- ToolStripSeparator.cs
- Label.cs
- SmtpMail.cs
- XmlSchemaSimpleTypeList.cs
- ClientSettingsSection.cs
- ContentElement.cs
- GridViewRowCollection.cs
- ReferenceEqualityComparer.cs
- ConfigurationLocation.cs
- NullableIntAverageAggregationOperator.cs
- CompatibleIComparer.cs
- EncryptedData.cs
- FlowNode.cs
- SafeNativeMethods.cs
- ProtocolsSection.cs
- CalloutQueueItem.cs
- ModuleBuilder.cs