Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Routing / System / ServiceModel / Routing / SendOperation.cs / 1305376 / SendOperation.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Routing { using System; using System.Collections.Generic; using System.ServiceModel.Channels; using System.ServiceModel.Description; using System.Transactions; using System.Runtime; using System.Configuration; class SendOperation { ListendpointTraits; int currentIndex; bool sent; Dictionary exceptions; OperationContext operationContext; Type routerContract; public SendOperation(IEnumerable endpoints, Type routerContract, OperationContext operationContext) { this.operationContext = operationContext; this.routerContract = routerContract; this.endpointTraits = new List (); foreach (ServiceEndpoint endpoint in endpoints) { this.endpointTraits.Add(new RoutingEndpointTrait(routerContract, endpoint, operationContext)); } if (this.endpointTraits.Count == 0) { throw FxTrace.Exception.AsError(new ConfigurationErrorsException(SR.BackupListEmpty)); } } public RoutingEndpointTrait CurrentEndpoint { get { Fx.Assert(this.currentIndex < this.endpointTraits.Count, "CurrentEndpoint should not be accessed after TryMoveToAlternate returned false!"); RoutingEndpointTrait trait = this.endpointTraits[this.currentIndex]; return trait; } } public bool HasAlternate { get { return this.currentIndex < (this.endpointTraits.Count - 1); } } public bool Sent { get { return this.sent; } } public void PrepareMessage(Message message) { if (this.exceptions != null) { message.Properties["Exceptions"] = this.exceptions; } } public void TransmitSucceeded(Transaction sendTransaction) { if (sendTransaction == null) { this.sent = true; } } public bool TryMoveToAlternate(Exception exception) { if (this.exceptions == null) { this.exceptions = new Dictionary (); } this.exceptions[this.CurrentEndpoint.Endpoint.Name] = exception; this.sent = false; if (++this.currentIndex < this.endpointTraits.Count) { return true; } return false; } } } // 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
- XmlDataImplementation.cs
- UserControlParser.cs
- RowType.cs
- ServiceInstallComponent.cs
- GradientSpreadMethodValidation.cs
- Latin1Encoding.cs
- DashStyles.cs
- WebPartManager.cs
- WebPartHeaderCloseVerb.cs
- LogStream.cs
- Int32RectConverter.cs
- AuthorizationRule.cs
- TrustManager.cs
- Compiler.cs
- TextServicesHost.cs
- DataGridViewAccessibleObject.cs
- COM2PropertyPageUITypeConverter.cs
- Oid.cs
- PropertyOverridesTypeEditor.cs
- DataSourceCache.cs
- GenericTypeParameterBuilder.cs
- SystemException.cs
- mda.cs
- TemplateInstanceAttribute.cs
- SkipQueryOptionExpression.cs
- LayoutUtils.cs
- PropertyConverter.cs
- CodeValidator.cs
- StylusPlugInCollection.cs
- DataGridViewIntLinkedList.cs
- Membership.cs
- WebPartConnectionsDisconnectVerb.cs
- XmlArrayAttribute.cs
- KnownTypesHelper.cs
- AnnotationComponentChooser.cs
- LinqDataSourceSelectEventArgs.cs
- StylusPointProperties.cs
- EntityReference.cs
- SafeLocalMemHandle.cs
- RawContentTypeMapper.cs
- selecteditemcollection.cs
- TypeConverters.cs
- TagMapCollection.cs
- XmlWellformedWriterHelpers.cs
- ConfigurationValues.cs
- initElementDictionary.cs
- DataSourceControlBuilder.cs
- XmlJsonWriter.cs
- IntersectQueryOperator.cs
- TextEditorCharacters.cs
- HMACMD5.cs
- SweepDirectionValidation.cs
- CurrentChangingEventArgs.cs
- ImplicitInputBrush.cs
- BackgroundWorker.cs
- ListViewPagedDataSource.cs
- OperatingSystem.cs
- ToolboxComponentsCreatingEventArgs.cs
- SHA1.cs
- ToolStripComboBox.cs
- SourceSwitch.cs
- ContextToken.cs
- BuildProvider.cs
- EmbeddedMailObjectsCollection.cs
- InvokeHandlers.cs
- XmlStreamStore.cs
- MultipartIdentifier.cs
- WindowManager.cs
- WhitespaceSignificantCollectionAttribute.cs
- PerfCounters.cs
- AutomationPeer.cs
- NoPersistProperty.cs
- IdentityHolder.cs
- ValidatedMobileControlConverter.cs
- ThrowHelper.cs
- SelfIssuedAuthProofToken.cs
- DBParameter.cs
- StyleXamlParser.cs
- NativeRightsManagementAPIsStructures.cs
- DataGridCommandEventArgs.cs
- CacheOutputQuery.cs
- Region.cs
- EmbeddedMailObjectsCollection.cs
- DiagnosticEventProvider.cs
- WSSecurityJan2004.cs
- TraceUtils.cs
- Emitter.cs
- BulletChrome.cs
- Canvas.cs
- DataObjectCopyingEventArgs.cs
- ObjectConverter.cs
- ProgressChangedEventArgs.cs
- AttributeCollection.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- SetStateDesigner.cs
- RoutedCommand.cs
- StrongNameKeyPair.cs
- DBCommand.cs
- SafeProcessHandle.cs
- LinqDataSourceContextData.cs