Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / SqlDataSourceCache.cs / 1 / SqlDataSourceCache.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI {
using System.Collections;
using System.ComponentModel;
using System.Web.Caching;
internal sealed class SqlDataSourceCache : DataSourceCache {
internal const string Sql9CacheDependencyDirective = "CommandNotification";
///
/// A semi-colon delimited string indicating which databases to use for the dependency in the format "database1:table1;database2:table2".
///
public string SqlCacheDependency {
get {
object o = ViewState["SqlCacheDependency"];
if (o != null)
return (string)o;
return String.Empty;
}
set {
ViewState["SqlCacheDependency"] = value;
}
}
#if !FEATURE_PAL // FEATURE_PAL does not fully enable SQL dependencies
///
/// Saves data to the ASP.NET cache using the specified key.
///
protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) {
string sqlCacheDependency = SqlCacheDependency;
// Here we only create cache dependencies for SQL Server 2000 and
// earlier that use a polling based mechanism. For SQL Server 2005
// and after, the data source itself creates the SqlCacheDependency
// and passes it in as a parameter.
if (sqlCacheDependency.Length > 0 && !String.Equals(sqlCacheDependency, Sql9CacheDependencyDirective, StringComparison.OrdinalIgnoreCase)) {
// Call internal helper method to parse the dependency list
CacheDependency sqlDependency = System.Web.Caching.SqlCacheDependency.CreateOutputCacheDependency(sqlCacheDependency);
if (dependency != null) {
// There was another dependency passed in, aggregate them
AggregateCacheDependency aggregateDependency = new AggregateCacheDependency();
aggregateDependency.Add(sqlDependency, dependency);
dependency = aggregateDependency;
}
else {
// No other dependencies, just the SQL one
dependency = sqlDependency;
}
}
base.SaveDataToCacheInternal(key, data, dependency);
}
#endif // !FEATURE_PAL
}
}
// 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;
using System.ComponentModel;
using System.Web.Caching;
internal sealed class SqlDataSourceCache : DataSourceCache {
internal const string Sql9CacheDependencyDirective = "CommandNotification";
///
/// A semi-colon delimited string indicating which databases to use for the dependency in the format "database1:table1;database2:table2".
///
public string SqlCacheDependency {
get {
object o = ViewState["SqlCacheDependency"];
if (o != null)
return (string)o;
return String.Empty;
}
set {
ViewState["SqlCacheDependency"] = value;
}
}
#if !FEATURE_PAL // FEATURE_PAL does not fully enable SQL dependencies
///
/// Saves data to the ASP.NET cache using the specified key.
///
protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) {
string sqlCacheDependency = SqlCacheDependency;
// Here we only create cache dependencies for SQL Server 2000 and
// earlier that use a polling based mechanism. For SQL Server 2005
// and after, the data source itself creates the SqlCacheDependency
// and passes it in as a parameter.
if (sqlCacheDependency.Length > 0 && !String.Equals(sqlCacheDependency, Sql9CacheDependencyDirective, StringComparison.OrdinalIgnoreCase)) {
// Call internal helper method to parse the dependency list
CacheDependency sqlDependency = System.Web.Caching.SqlCacheDependency.CreateOutputCacheDependency(sqlCacheDependency);
if (dependency != null) {
// There was another dependency passed in, aggregate them
AggregateCacheDependency aggregateDependency = new AggregateCacheDependency();
aggregateDependency.Add(sqlDependency, dependency);
dependency = aggregateDependency;
}
else {
// No other dependencies, just the SQL one
dependency = sqlDependency;
}
}
base.SaveDataToCacheInternal(key, data, dependency);
}
#endif // !FEATURE_PAL
}
}
// 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
- StatusBarPanel.cs
- Aes.cs
- ImplicitInputBrush.cs
- HtmlElementErrorEventArgs.cs
- ParagraphResult.cs
- GenericWebPart.cs
- LoginView.cs
- Line.cs
- TrackPoint.cs
- ProcessHostConfigUtils.cs
- UICuesEvent.cs
- TypedTableBase.cs
- VisualStateGroup.cs
- CultureInfo.cs
- TemplateBindingExtensionConverter.cs
- XPathBuilder.cs
- ProviderSettings.cs
- SelectionEditor.cs
- CardSpacePolicyElement.cs
- ModuleConfigurationInfo.cs
- DataControlCommands.cs
- DataGridParentRows.cs
- FixedSOMPageElement.cs
- HtmlTableRowCollection.cs
- Buffer.cs
- TemplateContainer.cs
- NamespaceInfo.cs
- ServiceBuildProvider.cs
- ProgressBarBrushConverter.cs
- LabelAutomationPeer.cs
- _UncName.cs
- FilterQuery.cs
- FixedTextContainer.cs
- MemberHolder.cs
- TextDecorationUnitValidation.cs
- ValueSerializer.cs
- AppearanceEditorPart.cs
- ValidationResults.cs
- ThumbAutomationPeer.cs
- MappingException.cs
- SoapProtocolImporter.cs
- CheckBoxBaseAdapter.cs
- ProfilePropertyMetadata.cs
- Listbox.cs
- GlyphTypeface.cs
- CurrencyWrapper.cs
- DoWorkEventArgs.cs
- RegexGroupCollection.cs
- HtmlTableCellCollection.cs
- ReadContentAsBinaryHelper.cs
- ListViewGroup.cs
- ReferenceSchema.cs
- CodeGenerator.cs
- ExpressionNode.cs
- ButtonBaseAdapter.cs
- ChannelManager.cs
- NavigationPropertyEmitter.cs
- ObjectRef.cs
- COAUTHINFO.cs
- XPathDocumentIterator.cs
- ReaderWriterLock.cs
- BuildResult.cs
- TreeWalkHelper.cs
- HtmlTable.cs
- MultipartIdentifier.cs
- PerformanceCounterPermission.cs
- SmtpCommands.cs
- DoubleAnimationBase.cs
- HWStack.cs
- XmlSchemaSimpleContentRestriction.cs
- IRCollection.cs
- ExpressionBinding.cs
- ArraySet.cs
- IPHostEntry.cs
- httpapplicationstate.cs
- ManagedIStream.cs
- PropertyInformation.cs
- CryptoConfig.cs
- PerfCounters.cs
- MetabaseServerConfig.cs
- FastPropertyAccessor.cs
- TripleDES.cs
- WriteableBitmap.cs
- ErrorRuntimeConfig.cs
- PublisherMembershipCondition.cs
- ThemeableAttribute.cs
- xmlfixedPageInfo.cs
- PropertyGridEditorPart.cs
- TableLayoutCellPaintEventArgs.cs
- MessageFilterException.cs
- BinaryMessageEncoder.cs
- DataPager.cs
- DoubleAnimation.cs
- MasterPage.cs
- ConversionHelper.cs
- XmlSchemaDocumentation.cs
- RsaSecurityToken.cs
- OleDbEnumerator.cs
- SystemDropShadowChrome.cs
- OdbcCommand.cs