Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / TransactionFlowAttribute.cs / 1 / TransactionFlowAttribute.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel { using System.Collections.Generic; using System.ServiceModel.Dispatcher; using System.ServiceModel.Description; using System.Reflection; using System.Runtime.Serialization; using System.ServiceModel.Channels; [AttributeUsage(ServiceModelAttributeTargets.OperationBehavior)] public sealed class TransactionFlowAttribute : Attribute, IOperationBehavior { TransactionFlowOption transactions; public TransactionFlowAttribute(TransactionFlowOption transactions) { TransactionFlowBindingElement.ValidateOption(transactions); this.transactions= transactions; } public TransactionFlowOption Transactions { get { return this.transactions; } } internal static void OverrideFlow(BindingParameterCollection parameters, string action, MessageDirection direction, TransactionFlowOption option) { Dictionarydictionary = EnsureDictionary(parameters); DirectionalAction da = new DirectionalAction(direction, action); if (dictionary.ContainsKey(da)) { dictionary[da] = option; } else { dictionary.Add(da, option); } } static Dictionary EnsureDictionary(BindingParameterCollection parameters) { Dictionary dictionary = parameters.Find >(); if (dictionary == null) { dictionary = new Dictionary (); parameters.Add(dictionary); } return dictionary; } void ApplyBehavior(OperationDescription description, BindingParameterCollection parameters) { Dictionary dictionary = EnsureDictionary(parameters); dictionary.Add(new DirectionalAction(description.Messages[0].Direction, description.Messages[0].Action), this.transactions); } void IOperationBehavior.Validate(OperationDescription description) { } void IOperationBehavior.ApplyDispatchBehavior(OperationDescription description, DispatchOperation dispatch) { } void IOperationBehavior.AddBindingParameters(OperationDescription description, BindingParameterCollection parameters) { if (parameters == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("parameters"); ApplyBehavior(description, parameters); } 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
- WinEventHandler.cs
- DrawingAttributes.cs
- TextTreeText.cs
- FixedSOMImage.cs
- SqlDataSourceView.cs
- PageBorderless.cs
- RemotingConfigParser.cs
- XsdBuildProvider.cs
- RoleBoolean.cs
- FileSystemEventArgs.cs
- RankException.cs
- InvalidDocumentContentsException.cs
- NegatedCellConstant.cs
- RegexFCD.cs
- ParameterReplacerVisitor.cs
- Range.cs
- RegistryKey.cs
- KeyInterop.cs
- PointAnimationBase.cs
- DataGridViewColumnCollection.cs
- ICollection.cs
- ViewBase.cs
- DeclarationUpdate.cs
- BufferModesCollection.cs
- ThreadExceptionEvent.cs
- PipelineDeploymentState.cs
- GenerateTemporaryTargetAssembly.cs
- NotConverter.cs
- FixedFlowMap.cs
- TextRangeProviderWrapper.cs
- UnsafePeerToPeerMethods.cs
- BoundingRectTracker.cs
- ProxyHwnd.cs
- XamlToRtfParser.cs
- XPathSelfQuery.cs
- CustomValidator.cs
- EmptyQuery.cs
- SByteStorage.cs
- ResourceProviderFactory.cs
- _DisconnectOverlappedAsyncResult.cs
- UriScheme.cs
- ListBoxDesigner.cs
- __Filters.cs
- ComPersistableTypeElementCollection.cs
- DesignUtil.cs
- ScriptControlDescriptor.cs
- ThousandthOfEmRealDoubles.cs
- DesignerDataView.cs
- LineMetrics.cs
- ConfigXmlReader.cs
- StopStoryboard.cs
- XmlQualifiedName.cs
- MobileControlDesigner.cs
- ProjectionCamera.cs
- UpdateManifestForBrowserApplication.cs
- keycontainerpermission.cs
- TreeSet.cs
- RuleInfoComparer.cs
- webeventbuffer.cs
- CodeBinaryOperatorExpression.cs
- controlskin.cs
- ContextMenu.cs
- DataGridrowEditEndingEventArgs.cs
- TriggerActionCollection.cs
- Cursor.cs
- ProcessManager.cs
- GroupBoxAutomationPeer.cs
- SchemaTableOptionalColumn.cs
- ObjectListCommand.cs
- SchemaEntity.cs
- AxHost.cs
- FrameworkElementFactoryMarkupObject.cs
- KeyMatchBuilder.cs
- HttpWebRequestElement.cs
- WebPartCancelEventArgs.cs
- SqlWebEventProvider.cs
- PingReply.cs
- GregorianCalendarHelper.cs
- BufferAllocator.cs
- RootDesignerSerializerAttribute.cs
- DataGridViewHitTestInfo.cs
- XmlParser.cs
- TextBoxBase.cs
- TaiwanLunisolarCalendar.cs
- ParamArrayAttribute.cs
- ValidationErrorInfo.cs
- ResourceDisplayNameAttribute.cs
- WebPartDisplayMode.cs
- SymmetricSecurityProtocol.cs
- PropertyTabAttribute.cs
- GridViewSelectEventArgs.cs
- RangeValidator.cs
- WindowsListViewItem.cs
- WebCategoryAttribute.cs
- ServiceControllerDesigner.cs
- SHA1CryptoServiceProvider.cs
- SpecialFolderEnumConverter.cs
- CodeNamespaceCollection.cs
- ValidationRuleCollection.cs
- SQLInt16Storage.cs