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
- BeginEvent.cs
- ACE.cs
- SingleConverter.cs
- InfoCardSchemas.cs
- ClientSettingsProvider.cs
- SHA512Cng.cs
- FormsAuthenticationConfiguration.cs
- PublisherIdentityPermission.cs
- ClientCredentialsElement.cs
- HtmlInputControl.cs
- HitTestParameters.cs
- TemplateField.cs
- AxisAngleRotation3D.cs
- DefaultPrintController.cs
- OperationExecutionFault.cs
- Attribute.cs
- Calendar.cs
- DocumentPageViewAutomationPeer.cs
- TokenizerHelper.cs
- SimpleMailWebEventProvider.cs
- HandleRef.cs
- DesignerVerbCollection.cs
- ColorConverter.cs
- LocationUpdates.cs
- GeneralTransform3DTo2D.cs
- ReferencedAssembly.cs
- XmlKeywords.cs
- EmptyElement.cs
- DataGridCaption.cs
- XmlBaseWriter.cs
- TransactionManager.cs
- ColumnWidthChangedEvent.cs
- OleDbCommandBuilder.cs
- ParallelTimeline.cs
- InputScopeConverter.cs
- DelegatedStream.cs
- DataGridColumnDropSeparator.cs
- CodeConstructor.cs
- ChildrenQuery.cs
- ArrangedElement.cs
- XmlDictionaryReaderQuotas.cs
- MouseActionValueSerializer.cs
- Point.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ClientBuildManagerCallback.cs
- Random.cs
- Pair.cs
- XmlAttributeHolder.cs
- CacheHelper.cs
- Content.cs
- LexicalChunk.cs
- dataprotectionpermission.cs
- AccessKeyManager.cs
- _ProxyRegBlob.cs
- WindowsStatusBar.cs
- RunClient.cs
- Pair.cs
- ApplicationContext.cs
- PageThemeCodeDomTreeGenerator.cs
- StringUtil.cs
- figurelength.cs
- SiteMapDesignerDataSourceView.cs
- ProgressBarRenderer.cs
- PhysicalAddress.cs
- ElasticEase.cs
- HostVisual.cs
- InternalPermissions.cs
- InfoCard.cs
- SaveFileDialog.cs
- ComponentResourceKeyConverter.cs
- TaskDesigner.cs
- ISAPIWorkerRequest.cs
- arclist.cs
- ConfigurationLocationCollection.cs
- Translator.cs
- Int64KeyFrameCollection.cs
- AmbiguousMatchException.cs
- assemblycache.cs
- MeasureItemEvent.cs
- Clipboard.cs
- DataControlImageButton.cs
- XmlBindingWorker.cs
- ServiceReference.cs
- TreeViewEvent.cs
- XsdBuildProvider.cs
- sqlcontext.cs
- UpdateManifestForBrowserApplication.cs
- InputScopeAttribute.cs
- Errors.cs
- TreeBuilder.cs
- TemplatedMailWebEventProvider.cs
- HttpContextServiceHost.cs
- Barrier.cs
- LogicalExpr.cs
- WebPartEditorCancelVerb.cs
- UpdateDelegates.Generated.cs
- SafeSystemMetrics.cs
- TreeBuilder.cs
- PeerCollaboration.cs
- MediaCommands.cs