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
- FormView.cs
- MapPathBasedVirtualPathProvider.cs
- XmlWellformedWriter.cs
- ErrorFormatter.cs
- hwndwrapper.cs
- RegexInterpreter.cs
- SpellCheck.cs
- XmlName.cs
- SmiRecordBuffer.cs
- LogArchiveSnapshot.cs
- MeshGeometry3D.cs
- StringUtil.cs
- StateRuntime.cs
- PropertyDescriptorCollection.cs
- CodeAttachEventStatement.cs
- NameTable.cs
- Sql8ExpressionRewriter.cs
- ToolStripSettings.cs
- XmlSchemaExternal.cs
- QueryCacheManager.cs
- EntitySetDataBindingList.cs
- ButtonPopupAdapter.cs
- AttributeSetAction.cs
- ParallelQuery.cs
- ManagedWndProcTracker.cs
- MaskInputRejectedEventArgs.cs
- assertwrapper.cs
- LocalizableAttribute.cs
- CqlBlock.cs
- BaseAddressElement.cs
- ControlPropertyNameConverter.cs
- TraceSwitch.cs
- MouseDevice.cs
- LayoutEvent.cs
- HostedHttpContext.cs
- SqlXml.cs
- Set.cs
- VisualStyleTypesAndProperties.cs
- XmlSchemaSet.cs
- SystemIPv6InterfaceProperties.cs
- ReferentialConstraint.cs
- AssemblyAttributesGoHere.cs
- DrawingAttributeSerializer.cs
- BuildProvider.cs
- EventProviderWriter.cs
- WebDisplayNameAttribute.cs
- IndicShape.cs
- HostingEnvironmentException.cs
- autovalidator.cs
- ButtonRenderer.cs
- ItemAutomationPeer.cs
- ContainerParaClient.cs
- XmlSchemaAppInfo.cs
- TransformPattern.cs
- ResourceCodeDomSerializer.cs
- TypeUnloadedException.cs
- SelectionItemProviderWrapper.cs
- BufferBuilder.cs
- ResourceExpressionEditorSheet.cs
- oledbconnectionstring.cs
- PeerFlooder.cs
- ClientRoleProvider.cs
- TableLayoutSettings.cs
- ParameterToken.cs
- SQLBinaryStorage.cs
- DBSqlParserTableCollection.cs
- FormsAuthenticationUser.cs
- DynamicUpdateCommand.cs
- BitmapEffectOutputConnector.cs
- RotateTransform3D.cs
- DelegateSerializationHolder.cs
- HeaderedItemsControl.cs
- BehaviorEditorPart.cs
- WSHttpBindingCollectionElement.cs
- CheckBoxAutomationPeer.cs
- CommonDialog.cs
- ClientBuildManagerCallback.cs
- MailDefinition.cs
- ScriptResourceDefinition.cs
- CardSpacePolicyElement.cs
- InternalMappingException.cs
- PublisherIdentityPermission.cs
- shaperfactoryquerycachekey.cs
- CodeTypeMember.cs
- QuaternionIndependentAnimationStorage.cs
- DrawingImage.cs
- FontSourceCollection.cs
- HtmlElementCollection.cs
- XmlName.cs
- ChildDocumentBlock.cs
- MultiSelector.cs
- BindingValueChangedEventArgs.cs
- SchemaElementDecl.cs
- InternalBase.cs
- SqlSelectClauseBuilder.cs
- HtmlInputPassword.cs
- NestedContainer.cs
- DataControlFieldCell.cs
- SafeFileHandle.cs
- XmlSchemaInfo.cs