Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / Web / AspNetCacheProfileAttribute.cs / 1305376 / AspNetCacheProfileAttribute.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Web
{
using System.ServiceModel.Activation;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
[AttributeUsage(AttributeTargets.Method)]
public sealed class AspNetCacheProfileAttribute : Attribute, IOperationBehavior
{
string cacheProfileName;
public AspNetCacheProfileAttribute(string cacheProfileName)
{
this.cacheProfileName = cacheProfileName;
}
public string CacheProfileName
{
get { return this.cacheProfileName; }
}
public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
{
} // do nothing
public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
{
} // do nothing
public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
{
if (!AspNetEnvironment.Current.AspNetCompatibilityEnabled)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR2.CacheProfileOnlySupportedInAspNetCompatibilityMode));
}
if (operationDescription.Behaviors.Find() == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR2.CacheProfileAttributeOnlyWithGet));
}
dispatchOperation.ParameterInspectors.Add(new CachingParameterInspector(this.cacheProfileName));
}
public void Validate(OperationDescription operationDescription)
{
// validation happens in ApplyDispatchBehavior because it is dispatcher specific
}
}
}
// 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
- ScrollBar.cs
- StaticSiteMapProvider.cs
- ChildrenQuery.cs
- ToolBarOverflowPanel.cs
- XmlSchemaComplexType.cs
- SqlInternalConnectionTds.cs
- RegionInfo.cs
- DiscreteKeyFrames.cs
- PackUriHelper.cs
- FreezableDefaultValueFactory.cs
- PageTextBox.cs
- xmlglyphRunInfo.cs
- WmlFormAdapter.cs
- SetterBaseCollection.cs
- TemplateControlCodeDomTreeGenerator.cs
- OleDbErrorCollection.cs
- KeyManager.cs
- Stacktrace.cs
- WebPartMenu.cs
- SelectionItemPatternIdentifiers.cs
- MetadataUtilsSmi.cs
- MenuItemCollection.cs
- DoubleAnimationUsingKeyFrames.cs
- WaveHeader.cs
- WindowsComboBox.cs
- DesignerDataTable.cs
- MarkupExtensionReturnTypeAttribute.cs
- ColumnMap.cs
- ClipboardData.cs
- Label.cs
- BindingEntityInfo.cs
- DelegateBodyWriter.cs
- OutOfMemoryException.cs
- DateBoldEvent.cs
- EntityStoreSchemaGenerator.cs
- EntityTypeEmitter.cs
- EndpointIdentity.cs
- WindowsListBox.cs
- UnsafeNativeMethods.cs
- GlobalizationAssembly.cs
- TextSchema.cs
- ViewPort3D.cs
- ServiceDebugBehavior.cs
- TransportSecurityProtocolFactory.cs
- Command.cs
- UnsafeNativeMethods.cs
- DefaultProxySection.cs
- TimeSpan.cs
- DesignerOptionService.cs
- ipaddressinformationcollection.cs
- ManagedIStream.cs
- ClientSettingsStore.cs
- SelectionProcessor.cs
- ObjectSpanRewriter.cs
- ScriptReferenceEventArgs.cs
- basevalidator.cs
- XamlSerializer.cs
- Helpers.cs
- SafeProcessHandle.cs
- MimeTypeMapper.cs
- DataGridTextColumn.cs
- ConstructorExpr.cs
- AttachedPropertyBrowsableAttribute.cs
- FigureHelper.cs
- PingOptions.cs
- CodeGotoStatement.cs
- UriScheme.cs
- WindowsTooltip.cs
- EDesignUtil.cs
- SplitterPanel.cs
- ClientFormsIdentity.cs
- OdbcInfoMessageEvent.cs
- ForeignKeyConstraint.cs
- SchemaInfo.cs
- DateTimeConverter.cs
- BuildProviderUtils.cs
- StringSorter.cs
- BuildResult.cs
- Polyline.cs
- ImageAutomationPeer.cs
- PageRanges.cs
- IntPtr.cs
- Scene3D.cs
- StatusBar.cs
- SymmetricKey.cs
- XPathArrayIterator.cs
- HttpHandlersSection.cs
- RotateTransform3D.cs
- WindowsAuthenticationModule.cs
- ClientSettingsSection.cs
- SqlMethodAttribute.cs
- AuthenticatedStream.cs
- SaveFileDialog.cs
- MetadataCache.cs
- ActivityExecutorDelegateInfo.cs
- PictureBox.cs
- DesignerActionTextItem.cs
- InvariantComparer.cs
- CalendarData.cs
- CurrencyManager.cs