Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / MsmqMessageProperty.cs / 1 / MsmqMessageProperty.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { public sealed class MsmqMessageProperty { public const string Name = "MsmqMessageProperty"; int abortCount; int moveCount; long lookupId; string messageId; int acknowledge; internal MsmqMessageProperty(MsmqInputMessage msmqMessage) { if (null == msmqMessage) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("msmqMessage"); this.lookupId = msmqMessage.LookupId.Value; if (msmqMessage.AbortCount != null) this.abortCount = msmqMessage.AbortCount.Value; if (msmqMessage.MoveCount != null) this.moveCount = msmqMessage.MoveCount.Value; this.acknowledge = (int)(ushort)msmqMessage.Class.Value; this.messageId = MsmqMessageId.ToString(msmqMessage.MessageId.Buffer); } public DeliveryFailure? DeliveryFailure { get { return TryGetDeliveryFailure(this.messageId, this.acknowledge); } } public DeliveryStatus? DeliveryStatus { get { DeliveryFailure? deliveryFailure = this.DeliveryFailure; if (!deliveryFailure.HasValue) return null; if (System.ServiceModel.Channels.DeliveryFailure.ReachQueueTimeout == deliveryFailure.Value || System.ServiceModel.Channels.DeliveryFailure.Unknown == deliveryFailure.Value) return System.ServiceModel.Channels.DeliveryStatus.InDoubt; else return System.ServiceModel.Channels.DeliveryStatus.NotDelivered; } } public int AbortCount { get { return this.abortCount; } internal set { this.abortCount = value; } } internal long LookupId { get { return this.lookupId; } } internal string MessageId { get { return this.messageId; } } public int MoveCount { get { return this.moveCount; } internal set { this.moveCount = value; } } public static MsmqMessageProperty Get(Message message) { if (null == message) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); if (null == message.Properties) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message.Properties"); return message.Properties[Name] as MsmqMessageProperty; } static DeliveryFailure? TryGetDeliveryFailure(string messageId, int acknowledgment) { // DeliveryFailure definintion explains these bit manipulations int bit15 = (1 << 15) & acknowledgment; if (0 == bit15) return null; int bit14 = (1 << 14) & acknowledgment; int otherBits = ~((1 << 15) | (1 << 14)) & acknowledgment; if ((0 == bit14 && otherBits >= 0 && otherBits <= 0x0A) || (0 != bit14 && otherBits >= 0 && otherBits <= 0x02)) return (DeliveryFailure)acknowledgment; else { MsmqDiagnostics.UnexpectedAcknowledgment(messageId, acknowledgment); return System.ServiceModel.Channels.DeliveryFailure.Unknown; } } } } // 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
- AuthStoreRoleProvider.cs
- Point3D.cs
- TypeValidationEventArgs.cs
- ParameterReplacerVisitor.cs
- SessionEndingCancelEventArgs.cs
- ConsumerConnectionPoint.cs
- PermissionAttributes.cs
- HMACSHA512.cs
- AsymmetricKeyExchangeFormatter.cs
- FileInfo.cs
- SoapReflectionImporter.cs
- SlotInfo.cs
- XPathMultyIterator.cs
- MarkupProperty.cs
- CodeMethodReturnStatement.cs
- HostingEnvironmentException.cs
- FullTextBreakpoint.cs
- EdmRelationshipRoleAttribute.cs
- SortedSet.cs
- ConnectorRouter.cs
- ClientUtils.cs
- EnumBuilder.cs
- URLAttribute.cs
- JsonCollectionDataContract.cs
- BackStopAuthenticationModule.cs
- ToggleProviderWrapper.cs
- GridErrorDlg.cs
- AbstractExpressions.cs
- InfoCardXmlSerializer.cs
- AvTraceFormat.cs
- SafePipeHandle.cs
- SimplePropertyEntry.cs
- ExtentCqlBlock.cs
- UrlMappingsModule.cs
- FillErrorEventArgs.cs
- LocalizedNameDescriptionPair.cs
- ButtonColumn.cs
- EntityAdapter.cs
- JapaneseLunisolarCalendar.cs
- ProcessHostConfigUtils.cs
- EnumBuilder.cs
- EventHandlersStore.cs
- Header.cs
- SecurityTokenSerializer.cs
- NamespaceExpr.cs
- __FastResourceComparer.cs
- _Semaphore.cs
- Attachment.cs
- XmlWrappingReader.cs
- StorageRoot.cs
- FullTextLine.cs
- TailCallAnalyzer.cs
- FormatterConverter.cs
- NetMsmqSecurityMode.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Icon.cs
- SchemaElementLookUpTable.cs
- ExtensionSimplifierMarkupObject.cs
- XmlNodeList.cs
- DragDeltaEventArgs.cs
- XmlValueConverter.cs
- ConstraintStruct.cs
- Stackframe.cs
- XmlNamespaceMapping.cs
- SystemNetHelpers.cs
- LockCookie.cs
- XamlHostingSection.cs
- XPathParser.cs
- ClrPerspective.cs
- ResumeStoryboard.cs
- ListenerConstants.cs
- MD5.cs
- CodeNamespaceImportCollection.cs
- ProcessRequestArgs.cs
- CharacterShapingProperties.cs
- Config.cs
- dataprotectionpermissionattribute.cs
- VoiceSynthesis.cs
- ButtonBaseAdapter.cs
- ResourcePermissionBase.cs
- CacheModeValueSerializer.cs
- GlyphTypeface.cs
- XmlHierarchicalEnumerable.cs
- PointCollection.cs
- StreamGeometry.cs
- ThreadAbortException.cs
- WorkflowInstance.cs
- AutoResetEvent.cs
- X509CertificateValidator.cs
- AuthenticatingEventArgs.cs
- TearOffProxy.cs
- ApplicationBuildProvider.cs
- PropertyValueUIItem.cs
- ReliableOutputConnection.cs
- EntityModelSchemaGenerator.cs
- GridItemCollection.cs
- LineGeometry.cs
- AddingNewEventArgs.cs
- GroupItem.cs
- Collection.cs