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
- Path.cs
- DataStorage.cs
- ComNativeDescriptor.cs
- TextDpi.cs
- RulePatternOps.cs
- TextEvent.cs
- Matrix3DStack.cs
- SingleAnimationUsingKeyFrames.cs
- IIS7WorkerRequest.cs
- StructuralType.cs
- OleDbFactory.cs
- ImageDrawing.cs
- NameSpaceExtractor.cs
- HeaderLabel.cs
- GlyphTypeface.cs
- XmlnsDefinitionAttribute.cs
- ScriptManagerProxy.cs
- OpenTypeLayoutCache.cs
- ProcessExitedException.cs
- MeshGeometry3D.cs
- SQLSingle.cs
- SerializationInfo.cs
- OleDbFactory.cs
- PageAsyncTaskManager.cs
- EpmTargetPathSegment.cs
- Utils.cs
- TypedReference.cs
- CqlIdentifiers.cs
- GraphicsState.cs
- WindowsStartMenu.cs
- ProxyFragment.cs
- ReflectionPermission.cs
- CoreChannel.cs
- TextRange.cs
- ConfigErrorGlyph.cs
- TdsParserHelperClasses.cs
- BufferedOutputAsyncStream.cs
- SecureUICommand.cs
- AuthorizationSection.cs
- StyleSelector.cs
- TextTreeTextElementNode.cs
- ParagraphResult.cs
- CompilationPass2Task.cs
- AdapterSwitches.cs
- ChtmlSelectionListAdapter.cs
- CommentAction.cs
- CngKeyCreationParameters.cs
- HebrewNumber.cs
- TaskFormBase.cs
- DataGridComboBoxColumn.cs
- WebRequestModulesSection.cs
- Pts.cs
- WebServiceHost.cs
- UIElementCollection.cs
- PropertyCollection.cs
- SrgsRulesCollection.cs
- ListView.cs
- SelectionUIService.cs
- Attribute.cs
- WebDescriptionAttribute.cs
- DocumentXPathNavigator.cs
- VirtualPathProvider.cs
- OdbcConnectionFactory.cs
- COM2ExtendedTypeConverter.cs
- NullableConverter.cs
- RegisteredScript.cs
- SchemeSettingElement.cs
- PeerDuplexChannelListener.cs
- DiscardableAttribute.cs
- BooleanConverter.cs
- DataServiceExpressionVisitor.cs
- PasswordBox.cs
- MaskDescriptor.cs
- ValuePattern.cs
- ResXBuildProvider.cs
- GC.cs
- InvalidateEvent.cs
- TileBrush.cs
- StateDesigner.cs
- AuthorizationRuleCollection.cs
- CornerRadiusConverter.cs
- EdmComplexPropertyAttribute.cs
- Argument.cs
- MetadataItem_Static.cs
- DateRangeEvent.cs
- AssemblyHash.cs
- ObjectManager.cs
- BrowserCapabilitiesFactory.cs
- PropertyExpression.cs
- LineInfo.cs
- connectionpool.cs
- HGlobalSafeHandle.cs
- BCryptHashAlgorithm.cs
- CommandHelpers.cs
- ObjectDataSourceDesigner.cs
- Menu.cs
- XmlQualifiedName.cs
- QilCloneVisitor.cs
- DelayedRegex.cs
- CapabilitiesSection.cs