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
- ellipse.cs
- HwndAppCommandInputProvider.cs
- XPathBuilder.cs
- Section.cs
- OpenTypeLayout.cs
- OperatorExpressions.cs
- LayoutTable.cs
- CodeActivityContext.cs
- SettingsContext.cs
- IPEndPoint.cs
- IImplicitResourceProvider.cs
- SortedList.cs
- SizeConverter.cs
- XPathAncestorQuery.cs
- BaseCodeDomTreeGenerator.cs
- ThicknessKeyFrameCollection.cs
- followingquery.cs
- DBBindings.cs
- CustomAttributeFormatException.cs
- TextTreeFixupNode.cs
- AggregationMinMaxHelpers.cs
- PeerApplication.cs
- Keywords.cs
- SqlBuilder.cs
- DocumentGridContextMenu.cs
- SoapHeaderException.cs
- XamlToRtfWriter.cs
- HttpListenerContext.cs
- ConditionCollection.cs
- FixedBufferAttribute.cs
- HelpOperationInvoker.cs
- ImageKeyConverter.cs
- SetState.cs
- DynamicField.cs
- XmlDictionaryReader.cs
- DateTimeUtil.cs
- _AuthenticationState.cs
- TriggerActionCollection.cs
- ControlCachePolicy.cs
- ExtenderControl.cs
- InternalBufferOverflowException.cs
- SqlBulkCopy.cs
- UnsafeNativeMethods.cs
- ReadOnlyDataSource.cs
- NGCSerializer.cs
- WindowsListViewGroup.cs
- ZipPackagePart.cs
- TextHidden.cs
- TokenFactoryBase.cs
- ConstantCheck.cs
- DiagnosticTraceSource.cs
- DoubleKeyFrameCollection.cs
- WebConfigurationHostFileChange.cs
- DesignTable.cs
- SimpleHandlerFactory.cs
- TextElementCollectionHelper.cs
- RootBrowserWindowAutomationPeer.cs
- PropertyManager.cs
- ContextStack.cs
- SR.cs
- HttpHostedTransportConfiguration.cs
- UpnEndpointIdentity.cs
- MetadataElement.cs
- FormatterServices.cs
- ParameterModifier.cs
- PolicyImporterElement.cs
- TraceFilter.cs
- BitHelper.cs
- ImageList.cs
- ConnectionOrientedTransportElement.cs
- RewritingValidator.cs
- RowVisual.cs
- RowType.cs
- Span.cs
- ISFTagAndGuidCache.cs
- ContainerTracking.cs
- PassportAuthenticationEventArgs.cs
- DeflateEmulationStream.cs
- UpdatePanelControlTrigger.cs
- ReflectionUtil.cs
- XmlQueryContext.cs
- PnrpPeerResolverBindingElement.cs
- CalendarDataBindingHandler.cs
- TemplatePartAttribute.cs
- EditorPartCollection.cs
- DeferredSelectedIndexReference.cs
- WebPartDisplayModeEventArgs.cs
- InProcStateClientManager.cs
- DefaultBindingPropertyAttribute.cs
- UrlAuthorizationModule.cs
- RepeatBehavior.cs
- UnionCodeGroup.cs
- _ConnectionGroup.cs
- EncoderFallback.cs
- FacetValueContainer.cs
- DataTableClearEvent.cs
- Privilege.cs
- StaticDataManager.cs
- TraceUtils.cs
- TextRunProperties.cs