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
- SamlEvidence.cs
- EpmContentSerializerBase.cs
- BamlReader.cs
- DeliveryRequirementsAttribute.cs
- VisualBasic.cs
- XmlSerializerVersionAttribute.cs
- FormsAuthenticationUser.cs
- SoapSchemaExporter.cs
- PrinterResolution.cs
- PrintEvent.cs
- GridPatternIdentifiers.cs
- FontSource.cs
- ExternalException.cs
- AuthenticationModuleElement.cs
- UpDownBase.cs
- ByteAnimationBase.cs
- FontInfo.cs
- ItemAutomationPeer.cs
- Image.cs
- ListDictionaryInternal.cs
- MatrixValueSerializer.cs
- ClassHandlersStore.cs
- PagerSettings.cs
- xsdvalidator.cs
- OdbcEnvironment.cs
- SocketInformation.cs
- ProcessThread.cs
- TextRangeProviderWrapper.cs
- DataControlFieldCollection.cs
- XmlPreloadedResolver.cs
- ConnectionManagementSection.cs
- ResourceProviderFactory.cs
- DispatchWrapper.cs
- NumberFormatter.cs
- TraceSwitch.cs
- FormViewDeletedEventArgs.cs
- XmlTextAttribute.cs
- RowParagraph.cs
- SiteMapHierarchicalDataSourceView.cs
- WebPartManager.cs
- SiteMapSection.cs
- BufferAllocator.cs
- IndexerNameAttribute.cs
- WebReferencesBuildProvider.cs
- InputLangChangeEvent.cs
- EntryPointNotFoundException.cs
- MouseBinding.cs
- TrackingProfileDeserializationException.cs
- Rotation3DKeyFrameCollection.cs
- ChunkedMemoryStream.cs
- CodeCommentStatementCollection.cs
- Int32RectValueSerializer.cs
- PersonalizablePropertyEntry.cs
- LookupBindingPropertiesAttribute.cs
- StrokeNodeOperations2.cs
- FormatConvertedBitmap.cs
- DataSourceXmlSerializer.cs
- SafeProcessHandle.cs
- IRCollection.cs
- OrthographicCamera.cs
- SmiContext.cs
- MediaScriptCommandRoutedEventArgs.cs
- ClientScriptManagerWrapper.cs
- DefaultObjectMappingItemCollection.cs
- DataServiceRequest.cs
- ImageInfo.cs
- OracleConnectionStringBuilder.cs
- SqlInternalConnection.cs
- XsdDataContractExporter.cs
- PrinterSettings.cs
- ContextProperty.cs
- UserControlParser.cs
- DataTemplateKey.cs
- StoryFragments.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs
- LookupNode.cs
- StateDesigner.cs
- AssociationTypeEmitter.cs
- SafeNativeMethodsMilCoreApi.cs
- SessionChannels.cs
- SignedXml.cs
- AnnotationHighlightLayer.cs
- LayoutManager.cs
- SQLBoolean.cs
- RuleSettingsCollection.cs
- CodeRegionDirective.cs
- SqlCacheDependencySection.cs
- SqlProfileProvider.cs
- HttpMethodConstraint.cs
- ContractNamespaceAttribute.cs
- IMembershipProvider.cs
- BrushConverter.cs
- DiscoveryReference.cs
- UnaryNode.cs
- AffineTransform3D.cs
- PropertyFilterAttribute.cs
- ShaperBuffers.cs
- XPathNodeIterator.cs
- TypeDescriptionProviderAttribute.cs
- EventHandlers.cs