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
- KeyedHashAlgorithm.cs
- PageBreakRecord.cs
- SByte.cs
- ScriptComponentDescriptor.cs
- GifBitmapDecoder.cs
- RankException.cs
- XpsPackagingException.cs
- BitmapMetadata.cs
- CodeThrowExceptionStatement.cs
- ClientFormsAuthenticationCredentials.cs
- ConfigurationSchemaErrors.cs
- TransportationConfigurationTypeInstallComponent.cs
- _ScatterGatherBuffers.cs
- IfJoinedCondition.cs
- SerialStream.cs
- TagPrefixInfo.cs
- StringValueConverter.cs
- GridView.cs
- ClassHandlersStore.cs
- ArrangedElement.cs
- HitTestParameters3D.cs
- FileRegion.cs
- DrawingState.cs
- SoapTypeAttribute.cs
- ObjectSet.cs
- TiffBitmapDecoder.cs
- WebDescriptionAttribute.cs
- XmlRawWriter.cs
- PatternMatchRules.cs
- DecoderNLS.cs
- AttributeUsageAttribute.cs
- TrackingDataItemValue.cs
- CollectionsUtil.cs
- ProjectionPlan.cs
- ReadOnlyDataSource.cs
- FieldTemplateUserControl.cs
- CustomPeerResolverService.cs
- TaskFactory.cs
- ExpressionDumper.cs
- GroupBoxAutomationPeer.cs
- PropertyDescriptorGridEntry.cs
- PrimitiveXmlSerializers.cs
- querybuilder.cs
- ProfilePropertyNameValidator.cs
- DetailsViewPagerRow.cs
- Graph.cs
- EnumerableWrapperWeakToStrong.cs
- LocalizableAttribute.cs
- DefaultBinder.cs
- X509SecurityTokenAuthenticator.cs
- StrongName.cs
- DictionaryKeyPropertyAttribute.cs
- CustomAttributeFormatException.cs
- nulltextnavigator.cs
- ResourceDescriptionAttribute.cs
- DoubleAnimationUsingPath.cs
- _SSPIWrapper.cs
- NominalTypeEliminator.cs
- FlowDocumentPage.cs
- TypeDependencyAttribute.cs
- _ProxyRegBlob.cs
- xmlfixedPageInfo.cs
- AsyncCodeActivityContext.cs
- ClientUIRequest.cs
- GenericWebPart.cs
- ContractMethodParameterInfo.cs
- NullableIntSumAggregationOperator.cs
- MruCache.cs
- Variable.cs
- InternalSafeNativeMethods.cs
- DropDownList.cs
- PointLightBase.cs
- AppDomainFactory.cs
- XpsResourcePolicy.cs
- AnnotationAdorner.cs
- ValuePattern.cs
- SqlReferenceCollection.cs
- RotateTransform3D.cs
- ReflectionHelper.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- DecoderFallback.cs
- PathTooLongException.cs
- PropertyPath.cs
- XomlCompiler.cs
- AstNode.cs
- VBIdentifierNameEditor.cs
- PathStreamGeometryContext.cs
- InstancePersistence.cs
- HelloMessageApril2005.cs
- MultiByteCodec.cs
- DeviceContext.cs
- MappedMetaModel.cs
- EdmSchemaError.cs
- TransferMode.cs
- SectionInformation.cs
- RegionData.cs
- SmiSettersStream.cs
- XLinq.cs
- DependencyPropertyValueSerializer.cs
- FragmentQuery.cs