Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / 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. //------------------------------------------------------------------------------ //// 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Rule.cs
- ComponentEditorPage.cs
- GroupBoxAutomationPeer.cs
- SqlExpressionNullability.cs
- EnumValAlphaComparer.cs
- X509ChainElement.cs
- UnitySerializationHolder.cs
- HtmlTable.cs
- GridViewCommandEventArgs.cs
- OpenTypeMethods.cs
- WpfWebRequestHelper.cs
- InternalConfigEventArgs.cs
- PersonalizationAdministration.cs
- CompModSwitches.cs
- PeerInvitationResponse.cs
- GradientPanel.cs
- SettingsPropertyValue.cs
- TaiwanLunisolarCalendar.cs
- FontSourceCollection.cs
- ServiceOperation.cs
- AppDomainResourcePerfCounters.cs
- Matrix.cs
- NavigationEventArgs.cs
- WSHttpSecurity.cs
- LinearGradientBrush.cs
- SiblingIterators.cs
- HttpProtocolImporter.cs
- XLinq.cs
- FormsAuthenticationEventArgs.cs
- BooleanFunctions.cs
- SQLDoubleStorage.cs
- Decimal.cs
- PersonalizationProviderHelper.cs
- ProjectionPath.cs
- ConditionalAttribute.cs
- Application.cs
- X509IssuerSerialKeyIdentifierClause.cs
- TextServicesProperty.cs
- PartManifestEntry.cs
- ClearCollection.cs
- ToolBarDesigner.cs
- ColumnPropertiesGroup.cs
- SqlNodeAnnotations.cs
- XmlSchemaSubstitutionGroup.cs
- LoginUtil.cs
- AdvancedBindingPropertyDescriptor.cs
- SystemIPInterfaceStatistics.cs
- StringPropertyBuilder.cs
- SubMenuStyleCollection.cs
- ComponentEditorForm.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- XmlElementList.cs
- XmlNodeList.cs
- NotifyCollectionChangedEventArgs.cs
- DecimalAnimation.cs
- WrapperSecurityCommunicationObject.cs
- DataGridViewColumnEventArgs.cs
- ObjectDataSourceSelectingEventArgs.cs
- WebBrowsableAttribute.cs
- _LoggingObject.cs
- SocketException.cs
- XmlIgnoreAttribute.cs
- HttpPostServerProtocol.cs
- DependsOnAttribute.cs
- PassportAuthentication.cs
- TranslateTransform.cs
- PageBreakRecord.cs
- HttpHandlersSection.cs
- XmlDocumentSerializer.cs
- BindingBase.cs
- WhitespaceRuleReader.cs
- TrackingProfileSerializer.cs
- HierarchicalDataSourceDesigner.cs
- Object.cs
- HostProtectionException.cs
- CompositionCommandSet.cs
- MatcherBuilder.cs
- Exception.cs
- ExpressionPrinter.cs
- CompiledQueryCacheEntry.cs
- DBSqlParserColumn.cs
- _AutoWebProxyScriptHelper.cs
- PropertyManager.cs
- NumberFormatter.cs
- ContentElement.cs
- ScriptingProfileServiceSection.cs
- ClientEventManager.cs
- OleDbParameterCollection.cs
- UnicodeEncoding.cs
- Subtree.cs
- SafeNativeMethodsMilCoreApi.cs
- RequestQueue.cs
- WebPartVerb.cs
- XmlExceptionHelper.cs
- PropertyPathWorker.cs
- DataObjectPastingEventArgs.cs
- _BasicClient.cs
- basecomparevalidator.cs
- HostVisual.cs
- TextTreeTextNode.cs