Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / CreateSequenceResponse.cs / 1 / CreateSequenceResponse.cs
//---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Xml; sealed class CreateSequenceResponse : BodyWriter { EndpointAddress acceptAcksTo; AddressingVersion addressingVersion; Nullableexpires; UniqueId identifier; bool ordered; ReliableMessagingVersion reliableMessagingVersion; CreateSequenceResponse() : base(true) { } public CreateSequenceResponse(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion) : base(true) { this.addressingVersion = addressingVersion; this.reliableMessagingVersion = reliableMessagingVersion; } public EndpointAddress AcceptAcksTo { get { return this.acceptAcksTo; } set { this.acceptAcksTo = value; } } public Nullable Expires { get { return this.expires; } set { this.expires = value; } } public UniqueId Identifier { get { return this.identifier; } set { this.identifier = value; } } public bool Ordered { get { return this.ordered; } set { this.ordered = value; } } public static CreateSequenceResponseInfo Create(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, XmlDictionaryReader reader) { if (reader == null) { DiagnosticUtility.DebugAssert("Argument reader cannot be null."); } CreateSequenceResponseInfo createSequenceResponse = new CreateSequenceResponseInfo(); WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary; XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(reliableMessagingVersion); reader.ReadStartElement(wsrmFeb2005Dictionary.CreateSequenceResponse, wsrmNs); reader.ReadStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs); createSequenceResponse.Identifier = reader.ReadContentAsUniqueId(); reader.ReadEndElement(); if (reader.IsStartElement(wsrmFeb2005Dictionary.Expires, wsrmNs)) { reader.ReadElementContentAsTimeSpan(); } if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) { if (reader.IsStartElement(DXD.Wsrm11Dictionary.IncompleteSequenceBehavior, wsrmNs)) { string incompleteSequenceBehavior = reader.ReadElementContentAsString(); if ((incompleteSequenceBehavior != Wsrm11Strings.DiscardEntireSequence) && (incompleteSequenceBehavior != Wsrm11Strings.DiscardFollowingFirstGap) && (incompleteSequenceBehavior != Wsrm11Strings.NoDiscard)) { string reason = SR.GetString(SR.CSResponseWithInvalidIncompleteSequenceBehavior); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(reason)); } // Otherwise ignore the value. } } if (reader.IsStartElement(wsrmFeb2005Dictionary.Accept, wsrmNs)) { reader.ReadStartElement(); createSequenceResponse.AcceptAcksTo = EndpointAddress.ReadFrom(addressingVersion, reader, wsrmFeb2005Dictionary.AcksTo, wsrmNs); while (reader.IsStartElement()) { reader.Skip(); } reader.ReadEndElement(); } while (reader.IsStartElement()) { reader.Skip(); } reader.ReadEndElement(); return createSequenceResponse; } protected override void OnWriteBodyContents(XmlDictionaryWriter writer) { WsrmFeb2005Dictionary wsrmFeb2005Dictionary = XD.WsrmFeb2005Dictionary; XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(this.reliableMessagingVersion); writer.WriteStartElement(wsrmFeb2005Dictionary.CreateSequenceResponse, wsrmNs); writer.WriteStartElement(wsrmFeb2005Dictionary.Identifier, wsrmNs); writer.WriteValue(this.identifier); writer.WriteEndElement(); if (this.expires.HasValue) { writer.WriteStartElement(wsrmFeb2005Dictionary.Expires, wsrmNs); writer.WriteValue(this.expires.Value); writer.WriteEndElement(); } if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) { Wsrm11Dictionary wsrm11Dictionary = DXD.Wsrm11Dictionary; writer.WriteStartElement(wsrm11Dictionary.IncompleteSequenceBehavior, wsrmNs); writer.WriteValue( this.ordered ? wsrm11Dictionary.DiscardFollowingFirstGap : wsrm11Dictionary.NoDiscard); writer.WriteEndElement(); } if (this.acceptAcksTo != null) { writer.WriteStartElement(wsrmFeb2005Dictionary.Accept, wsrmNs); this.acceptAcksTo.WriteTo(this.addressingVersion, writer, wsrmFeb2005Dictionary.AcksTo, wsrmNs); 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
- GridLengthConverter.cs
- OracleNumber.cs
- TypefaceCollection.cs
- ScriptingAuthenticationServiceSection.cs
- ImageFormat.cs
- HierarchicalDataTemplate.cs
- KerberosTokenFactoryCredential.cs
- EnumUnknown.cs
- HostExecutionContextManager.cs
- DataFieldConverter.cs
- MappingModelBuildProvider.cs
- DoubleStorage.cs
- CallbackHandler.cs
- NetStream.cs
- MethodBuilderInstantiation.cs
- OutgoingWebResponseContext.cs
- XMLSchema.cs
- OracleRowUpdatingEventArgs.cs
- NotifyParentPropertyAttribute.cs
- CodeArrayCreateExpression.cs
- ContractMethodInfo.cs
- DataFormat.cs
- CryptoConfig.cs
- SafeHandle.cs
- MetaTable.cs
- PolyQuadraticBezierSegment.cs
- TransformProviderWrapper.cs
- HttpCachePolicy.cs
- ListParagraph.cs
- ImageList.cs
- _SslSessionsCache.cs
- FilterElement.cs
- PersonalizablePropertyEntry.cs
- TextRenderingModeValidation.cs
- Version.cs
- GeometryHitTestParameters.cs
- Rect3D.cs
- HttpCookie.cs
- TextEditorCopyPaste.cs
- ExpressionBuilderContext.cs
- DesignerOptionService.cs
- Vector3DConverter.cs
- ErrorFormatter.cs
- FormatSettings.cs
- nulltextnavigator.cs
- TransformPattern.cs
- XmlCharacterData.cs
- AssemblyCollection.cs
- InvokeProviderWrapper.cs
- OdbcException.cs
- AxisAngleRotation3D.cs
- PolyBezierSegment.cs
- XmlMapping.cs
- DetailsView.cs
- TextContainerChangedEventArgs.cs
- BuildDependencySet.cs
- thaishape.cs
- SqlFileStream.cs
- DataGridCommandEventArgs.cs
- HMACSHA256.cs
- CorrelationHandle.cs
- DialogResultConverter.cs
- GridViewColumnCollectionChangedEventArgs.cs
- MissingMethodException.cs
- HierarchicalDataSourceControl.cs
- TagPrefixInfo.cs
- TransactionBehavior.cs
- OdbcConnectionPoolProviderInfo.cs
- Codec.cs
- ReadOnlyCollection.cs
- SingleObjectCollection.cs
- DataGridViewAccessibleObject.cs
- TreeViewDesigner.cs
- ContextMarshalException.cs
- InstalledFontCollection.cs
- PresentationSource.cs
- ServiceModelEnumValidatorAttribute.cs
- FileFormatException.cs
- DebuggerAttributes.cs
- RuleSettingsCollection.cs
- UrlMapping.cs
- WindowsStreamSecurityElement.cs
- MobileListItem.cs
- MetadataArtifactLoader.cs
- IRCollection.cs
- QilTargetType.cs
- PriorityRange.cs
- ConsoleCancelEventArgs.cs
- WebPartHelpVerb.cs
- KnownTypes.cs
- EdmEntityTypeAttribute.cs
- DesignerOptionService.cs
- FormViewRow.cs
- RawStylusInputCustomData.cs
- VectorConverter.cs
- JoinElimination.cs
- WebUtility.cs
- EncryptedType.cs
- IndexedSelectQueryOperator.cs
- EncryptedKeyIdentifierClause.cs