Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / OperationBehaviorAttribute.cs / 1 / OperationBehaviorAttribute.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel { using System.Reflection; using System.ServiceModel.Channels; using System.ServiceModel.Dispatcher; using System.ServiceModel.Description; using System.Transactions; using System.ServiceModel.Security; using System.Security.Principal; using System.Collections.Generic; [AttributeUsage(ServiceModelAttributeTargets.OperationBehavior)] public sealed class OperationBehaviorAttribute : Attribute, IOperationBehavior { internal const ImpersonationOption DefaultImpersonationOption = ImpersonationOption.NotAllowed; bool autoCompleteTransaction = true; bool autoEnlistTransaction = false; bool autoDisposeParameters = true; ImpersonationOption impersonation = ImpersonationOption.NotAllowed; ReleaseInstanceMode releaseInstance = ReleaseInstanceMode.None; public bool TransactionAutoComplete { get { return this.autoCompleteTransaction; } set { this.autoCompleteTransaction = value; } } public bool TransactionScopeRequired { get { return this.autoEnlistTransaction; } set { this.autoEnlistTransaction = value; } } public bool AutoDisposeParameters { get { return this.autoDisposeParameters; } set { this.autoDisposeParameters = value; } } public ImpersonationOption Impersonation { get { return this.impersonation; } set { if (!ImpersonationOptionHelper.IsDefined(value)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); this.impersonation = value; } } public ReleaseInstanceMode ReleaseInstanceMode { get { return this.releaseInstance; } set { if (!ReleaseInstanceModeHelper.IsDefined(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value")); } this.releaseInstance = value; } } void IOperationBehavior.Validate(OperationDescription description) { } void IOperationBehavior.AddBindingParameters(OperationDescription description, BindingParameterCollection parameters) { } void IOperationBehavior.ApplyDispatchBehavior(OperationDescription description, DispatchOperation dispatch) { if (description == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description"); } if (dispatch == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dispatch"); } if (description.IsServerInitiated() && this.releaseInstance != ReleaseInstanceMode.None) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.SFxOperationBehaviorAttributeReleaseInstanceModeDoesNotApplyToCallback, description.Name))); } dispatch.TransactionRequired = this.autoEnlistTransaction; dispatch.TransactionAutoComplete = this.autoCompleteTransaction; dispatch.AutoDisposeParameters = this.autoDisposeParameters; dispatch.ReleaseInstanceBeforeCall = (this.releaseInstance & ReleaseInstanceMode.BeforeCall) != 0; dispatch.ReleaseInstanceAfterCall = (this.releaseInstance & ReleaseInstanceMode.AfterCall) != 0; dispatch.Impersonation = this.Impersonation; } void IOperationBehavior.ApplyClientBehavior(OperationDescription description, ClientOperation proxy) { } } } // 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
- QuaternionIndependentAnimationStorage.cs
- SqlDataSourceCache.cs
- XMLUtil.cs
- Durable.cs
- WebExceptionStatus.cs
- BinHexEncoder.cs
- CssStyleCollection.cs
- TextViewBase.cs
- CollectionChangeEventArgs.cs
- GetImportFileNameRequest.cs
- XmlLinkedNode.cs
- SoapAttributeOverrides.cs
- StringArrayConverter.cs
- MemberAccessException.cs
- ElementNotAvailableException.cs
- templategroup.cs
- Control.cs
- _LoggingObject.cs
- BuildProviderCollection.cs
- RightNameExpirationInfoPair.cs
- MediaPlayer.cs
- ProviderSettings.cs
- ServiceThrottlingElement.cs
- DesignerVerb.cs
- StringHandle.cs
- ValidationSummary.cs
- ReadOnlyDataSourceView.cs
- SplashScreen.cs
- FontNamesConverter.cs
- NetNamedPipeSecurityMode.cs
- CompilerGlobalScopeAttribute.cs
- InputBindingCollection.cs
- ComponentDispatcherThread.cs
- TreeViewTemplateSelector.cs
- Calendar.cs
- ButtonField.cs
- CodeArrayCreateExpression.cs
- Rect3D.cs
- MulticastDelegate.cs
- DummyDataSource.cs
- WebPartVerbCollection.cs
- XpsFilter.cs
- PointConverter.cs
- RectangleHotSpot.cs
- AdapterUtil.cs
- HttpWebResponse.cs
- DataGridViewCellFormattingEventArgs.cs
- ItemType.cs
- SchemaName.cs
- VirtualPathUtility.cs
- IntellisenseTextBox.cs
- BasicAsyncResult.cs
- ProtectedConfigurationProviderCollection.cs
- WindowPattern.cs
- CatalogPartChrome.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- HttpApplication.cs
- NamespaceQuery.cs
- XPathCompiler.cs
- SamlAuthenticationStatement.cs
- DynamicActionMessageFilter.cs
- BindingListCollectionView.cs
- NavigatorInput.cs
- SerializerDescriptor.cs
- WebPartConnectionsConfigureVerb.cs
- XmlCountingReader.cs
- SimpleExpression.cs
- GridEntry.cs
- ContainerControl.cs
- StringCollectionMarkupSerializer.cs
- BooleanStorage.cs
- DataGridState.cs
- ListDictionary.cs
- CustomAssemblyResolver.cs
- GroupBox.cs
- RequiredAttributeAttribute.cs
- FrameworkContextData.cs
- ProxyRpc.cs
- IItemContainerGenerator.cs
- _LazyAsyncResult.cs
- HandlerFactoryWrapper.cs
- FontStyle.cs
- DocumentGridContextMenu.cs
- BooleanStorage.cs
- ResXFileRef.cs
- DataSourceNameHandler.cs
- SchemaComplexType.cs
- QueryOperatorEnumerator.cs
- SqlRecordBuffer.cs
- WebColorConverter.cs
- VarRefManager.cs
- IHttpResponseInternal.cs
- CatalogZoneBase.cs
- ElementHostPropertyMap.cs
- SqlDeflator.cs
- DesignerActionItemCollection.cs
- Win32Native.cs
- GuidelineCollection.cs
- LoginUtil.cs
- GlyphingCache.cs