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
- KeyValueInternalCollection.cs
- BlockCollection.cs
- SizeF.cs
- ControlPropertyNameConverter.cs
- elementinformation.cs
- InterleavedZipPartStream.cs
- IListConverters.cs
- MonikerHelper.cs
- Pair.cs
- ImageInfo.cs
- SafeEventLogWriteHandle.cs
- WebConfigurationHost.cs
- ToolStripItemCollection.cs
- Speller.cs
- XmlUnspecifiedAttribute.cs
- GcSettings.cs
- MatrixAnimationUsingKeyFrames.cs
- TextTreeTextBlock.cs
- SweepDirectionValidation.cs
- HtmlFormParameterReader.cs
- StreamGeometryContext.cs
- HtmlControl.cs
- AssociationTypeEmitter.cs
- UITypeEditor.cs
- SamlConstants.cs
- KeyTime.cs
- HostExecutionContextManager.cs
- DataBindingHandlerAttribute.cs
- EntityViewGenerationAttribute.cs
- NumberFormatInfo.cs
- CharEnumerator.cs
- BitmapEffectRenderDataResource.cs
- Speller.cs
- PeerResolverSettings.cs
- AttributeCollection.cs
- SystemTcpConnection.cs
- DragEvent.cs
- EntitySqlQueryState.cs
- BaseHashHelper.cs
- CodeDomSerializerBase.cs
- _OverlappedAsyncResult.cs
- WebPartHelpVerb.cs
- ContourSegment.cs
- SecurityProtocolFactory.cs
- MimeTypeMapper.cs
- NativeMethods.cs
- mediapermission.cs
- UIHelper.cs
- XmlTextWriter.cs
- _AutoWebProxyScriptEngine.cs
- WebServiceParameterData.cs
- DocumentXmlWriter.cs
- SoapTransportImporter.cs
- Constraint.cs
- EventManager.cs
- XPathDocumentBuilder.cs
- TypeToStringValueConverter.cs
- StringUtil.cs
- OleDbParameterCollection.cs
- InheritedPropertyDescriptor.cs
- TargetControlTypeCache.cs
- GeometryConverter.cs
- PageContentAsyncResult.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ValidatorCompatibilityHelper.cs
- _NetRes.cs
- DependentList.cs
- SqlError.cs
- AttributeUsageAttribute.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- RecognizerInfo.cs
- ProtocolsConfigurationEntry.cs
- SourceFilter.cs
- OdbcConnectionPoolProviderInfo.cs
- GetPageNumberCompletedEventArgs.cs
- XamlWriter.cs
- ProjectionNode.cs
- XmlTypeAttribute.cs
- PostBackTrigger.cs
- BitmapEffectDrawingContextState.cs
- AlgoModule.cs
- ByteRangeDownloader.cs
- AuthorizationRule.cs
- DbInsertCommandTree.cs
- TypeBuilder.cs
- OdbcConnectionStringbuilder.cs
- XPathAncestorIterator.cs
- SimpleWorkerRequest.cs
- DataTemplateKey.cs
- BrowserCapabilitiesFactoryBase.cs
- KeyValuePair.cs
- FontDialog.cs
- DataServiceException.cs
- WebContext.cs
- PeerApplication.cs
- QueueAccessMode.cs
- CharConverter.cs
- OleDbRowUpdatingEvent.cs
- Grid.cs
- CacheOutputQuery.cs