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
- ApplicationGesture.cs
- TokenFactoryCredential.cs
- OverloadGroupAttribute.cs
- SaveFileDialog.cs
- SecureEnvironment.cs
- documentsequencetextcontainer.cs
- AppSettingsExpressionBuilder.cs
- AssemblyResolver.cs
- StylusCaptureWithinProperty.cs
- LineGeometry.cs
- InfoCardRSACryptoProvider.cs
- PropertyChangeTracker.cs
- MultiView.cs
- CheckPair.cs
- TreeView.cs
- Int64Storage.cs
- CanonicalizationDriver.cs
- BitmapFrameEncode.cs
- SqlCommandBuilder.cs
- ContextMenu.cs
- XmlComment.cs
- TrackingProfileManager.cs
- ColumnResult.cs
- ContactManager.cs
- CollectionConverter.cs
- XmlToDatasetMap.cs
- WebPartZoneCollection.cs
- BitmapFrameEncode.cs
- ProxyElement.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ITextView.cs
- XmlWriterTraceListener.cs
- AsynchronousChannel.cs
- ELinqQueryState.cs
- CmsInterop.cs
- Registry.cs
- PolicyStatement.cs
- Scene3D.cs
- SystemResourceKey.cs
- CharAnimationUsingKeyFrames.cs
- QuaternionAnimation.cs
- HashLookup.cs
- XmlSchemaSimpleContentRestriction.cs
- MustUnderstandSoapException.cs
- WriteableBitmap.cs
- ColorInterpolationModeValidation.cs
- Binding.cs
- ActivationProxy.cs
- Missing.cs
- Socket.cs
- ProfilePropertySettingsCollection.cs
- parserscommon.cs
- SingleResultAttribute.cs
- InputLanguageEventArgs.cs
- RtfToXamlLexer.cs
- QilStrConcatenator.cs
- CuspData.cs
- BuilderInfo.cs
- FixUp.cs
- TypeDescriptionProvider.cs
- MoveSizeWinEventHandler.cs
- InvalidPropValue.cs
- CollectionViewProxy.cs
- NativeBuffer.cs
- CustomWebEventKey.cs
- _DomainName.cs
- SchemaImporter.cs
- WebConfigurationManager.cs
- HtmlTable.cs
- ReferentialConstraint.cs
- MessageEncodingBindingElement.cs
- SequentialUshortCollection.cs
- RadioButtonList.cs
- Clipboard.cs
- MaskedTextProvider.cs
- DataControlCommands.cs
- GenerateHelper.cs
- PeerApplicationLaunchInfo.cs
- WasAdminWrapper.cs
- WebMessageBodyStyleHelper.cs
- DataGridViewBand.cs
- EventData.cs
- HTTPNotFoundHandler.cs
- SecurityDocument.cs
- TerminatorSinks.cs
- MsmqOutputSessionChannel.cs
- SerTrace.cs
- URI.cs
- SqlBuffer.cs
- __ConsoleStream.cs
- UntypedNullExpression.cs
- TextTreePropertyUndoUnit.cs
- DynamicILGenerator.cs
- DataGridViewCellParsingEventArgs.cs
- EventLogPermissionEntry.cs
- ObjectItemConventionAssemblyLoader.cs
- AutomationPeer.cs
- DataPagerFieldCollection.cs
- ExtendedTransformFactory.cs
- DelegateSerializationHolder.cs