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
- DesignerActionGlyph.cs
- StackSpiller.Bindings.cs
- HostingPreferredMapPath.cs
- HwndAppCommandInputProvider.cs
- MILUtilities.cs
- Int32KeyFrameCollection.cs
- TemplatedEditableDesignerRegion.cs
- XmlSortKey.cs
- ConstructorExpr.cs
- XmlProcessingInstruction.cs
- HttpCachePolicy.cs
- TextParaClient.cs
- RuntimeConfig.cs
- UriParserTemplates.cs
- OdbcEnvironmentHandle.cs
- HScrollBar.cs
- XmlSerializerObjectSerializer.cs
- Page.cs
- TypedDataSourceCodeGenerator.cs
- HttpInputStream.cs
- DbUpdateCommandTree.cs
- DependencyObjectCodeDomSerializer.cs
- Predicate.cs
- RepeaterItemEventArgs.cs
- ObjectAssociationEndMapping.cs
- FontFamilyConverter.cs
- MobileControlsSectionHandler.cs
- Color.cs
- RemoteArgument.cs
- SqlClientMetaDataCollectionNames.cs
- ControlDesigner.cs
- ErrorWrapper.cs
- VisualTarget.cs
- CustomAttributeSerializer.cs
- TreeViewHitTestInfo.cs
- DataGridViewControlCollection.cs
- Policy.cs
- SqlMetaData.cs
- DataGridViewCellStateChangedEventArgs.cs
- ToolStripActionList.cs
- HuffCodec.cs
- EncoderBestFitFallback.cs
- RoleBoolean.cs
- XmlQueryOutput.cs
- InputBindingCollection.cs
- Missing.cs
- PropertyTab.cs
- OracleMonthSpan.cs
- VisualStyleInformation.cs
- DependencyPropertyConverter.cs
- DateRangeEvent.cs
- sitestring.cs
- ProtectedProviderSettings.cs
- XmlDictionaryReaderQuotas.cs
- ArrayList.cs
- SetterBase.cs
- SafeRightsManagementSessionHandle.cs
- BooleanAnimationBase.cs
- BamlRecordHelper.cs
- ToolStripGripRenderEventArgs.cs
- DataIdProcessor.cs
- Converter.cs
- GraphicsContext.cs
- PropertyPathConverter.cs
- AddInEnvironment.cs
- ZoomingMessageFilter.cs
- ListDependantCardsRequest.cs
- SelectionChangedEventArgs.cs
- DataControlFieldHeaderCell.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- ScrollItemProviderWrapper.cs
- Type.cs
- WebPartDescriptionCollection.cs
- MeshGeometry3D.cs
- metadatamappinghashervisitor.cs
- QuaternionValueSerializer.cs
- ColumnProvider.cs
- MessagePropertyVariants.cs
- HijriCalendar.cs
- IpcChannelHelper.cs
- Token.cs
- HttpRequest.cs
- TdsEnums.cs
- SafeArrayTypeMismatchException.cs
- DataConnectionHelper.cs
- UnmanagedMemoryStream.cs
- AssemblyResourceLoader.cs
- AttributeQuery.cs
- SendContent.cs
- CodeVariableReferenceExpression.cs
- LinqDataSourceView.cs
- BufferedGraphics.cs
- CodeIndexerExpression.cs
- SingleTagSectionHandler.cs
- MissingSatelliteAssemblyException.cs
- Pair.cs
- RuleInfoComparer.cs
- WebProxyScriptElement.cs
- EraserBehavior.cs
- ComboBoxDesigner.cs