Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / TerminateSequence.cs / 1 / TerminateSequence.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System; using System.ServiceModel; using System.ServiceModel.Diagnostics; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; sealed class TerminateSequence : BodyWriter { UniqueId identifier; Int64 lastMsgNumber; ReliableMessagingVersion reliableMessagingVersion; public TerminateSequence() : base(true) { } public TerminateSequence(ReliableMessagingVersion reliableMessagingVersion, UniqueId identifier, Int64 last) : base(true) { this.reliableMessagingVersion = reliableMessagingVersion; this.identifier = identifier; this.lastMsgNumber = last; } public static TerminateSequenceInfo Create(ReliableMessagingVersion reliableMessagingVersion, XmlDictionaryReader reader) { if (reader == null) { DiagnosticUtility.DebugAssert("Argument reader cannot be null."); } TerminateSequenceInfo terminateSequenceInfo = new TerminateSequenceInfo(); WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary; XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(reliableMessagingVersion); reader.ReadStartElement(wsrmFeb2005Dictionary.TerminateSequence, wsrmNs); reader.ReadStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs); terminateSequenceInfo.Identifier = reader.ReadContentAsUniqueId(); reader.ReadEndElement(); if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) { if (reader.IsStartElement(DXD.Wsrm11Dictionary.LastMsgNumber, wsrmNs)) { reader.ReadStartElement(); terminateSequenceInfo.LastMsgNumber = WsrmUtilities.ReadSequenceNumber(reader, false); reader.ReadEndElement(); } } while (reader.IsStartElement()) { reader.Skip(); } reader.ReadEndElement(); return terminateSequenceInfo; } protected override void OnWriteBodyContents(XmlDictionaryWriter writer) { WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary; XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(this.reliableMessagingVersion); writer.WriteStartElement(wsrmFeb2005Dictionary.TerminateSequence, wsrmNs); writer.WriteStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs); writer.WriteValue(this.identifier); writer.WriteEndElement(); if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) { if (this.lastMsgNumber > 0) { writer.WriteStartElement(DXD.Wsrm11Dictionary.LastMsgNumber, wsrmNs); writer.WriteValue(this.lastMsgNumber); writer.WriteEndElement(); } } writer.WriteEndElement(); } } } // 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
- BrowserInteropHelper.cs
- ObjectSet.cs
- PrivilegedConfigurationManager.cs
- IsolatedStoragePermission.cs
- KeyPullup.cs
- FlowPosition.cs
- ServiceDocument.cs
- ObjectTag.cs
- WhileDesigner.cs
- UniqueIdentifierService.cs
- SamlDoNotCacheCondition.cs
- XmlElement.cs
- PolygonHotSpot.cs
- StylusCaptureWithinProperty.cs
- SQLUtility.cs
- ProfileModule.cs
- FormViewInsertEventArgs.cs
- WebPartConnectionsCloseVerb.cs
- WebPartConnectionsCancelVerb.cs
- HtmlTable.cs
- MappingMetadataHelper.cs
- QuaternionAnimationBase.cs
- AssemblyBuilder.cs
- MailBnfHelper.cs
- LogicalChannel.cs
- PrintPreviewGraphics.cs
- GenericWebPart.cs
- SoapParser.cs
- AddInController.cs
- LexicalChunk.cs
- BitmapMetadataEnumerator.cs
- BooleanSwitch.cs
- GPRECTF.cs
- ValuePatternIdentifiers.cs
- HtmlInputSubmit.cs
- ModulesEntry.cs
- LinqDataSourceDeleteEventArgs.cs
- EventProviderBase.cs
- codemethodreferenceexpression.cs
- DocumentPaginator.cs
- UnauthorizedWebPart.cs
- DeclarativeExpressionConditionDeclaration.cs
- ItemsControl.cs
- DefaultHttpHandler.cs
- FtpWebResponse.cs
- ClonableStack.cs
- securitycriticaldata.cs
- MenuStrip.cs
- DataGridColumnCollection.cs
- PowerStatus.cs
- DataFormats.cs
- NamedServiceModelExtensionCollectionElement.cs
- ApplicationSecurityInfo.cs
- SHA256.cs
- MappingItemCollection.cs
- TableProvider.cs
- SqlBuilder.cs
- Accessible.cs
- InheritanceContextChangedEventManager.cs
- ClosableStream.cs
- CategoryEditor.cs
- MulticastNotSupportedException.cs
- TextStore.cs
- EdmType.cs
- MultiByteCodec.cs
- RuntimeConfig.cs
- ItemsControlAutomationPeer.cs
- CompareValidator.cs
- UserControl.cs
- XPathNode.cs
- DataGridParentRows.cs
- MemberHolder.cs
- Panel.cs
- ContextInformation.cs
- OdbcCommand.cs
- Pair.cs
- WindowsListViewItemStartMenu.cs
- SiteMapPath.cs
- ByteAnimationBase.cs
- SafeFileMapViewHandle.cs
- _Win32.cs
- BlurBitmapEffect.cs
- LoginName.cs
- Int16Storage.cs
- GridView.cs
- ConsumerConnectionPointCollection.cs
- BodyWriter.cs
- Predicate.cs
- WebBrowserNavigatedEventHandler.cs
- ListBoxItemWrapperAutomationPeer.cs
- httpapplicationstate.cs
- KeyFrames.cs
- SqlNotificationRequest.cs
- BaseTreeIterator.cs
- XmlSchemaSimpleTypeRestriction.cs
- DESCryptoServiceProvider.cs
- TextTreeUndo.cs
- QilPatternFactory.cs
- DataFieldConverter.cs
- DeploymentSectionCache.cs