WriteValue() публичный Метод

public WriteValue ( System.Guid value ) : void
value System.Guid
Результат void
        protected override void OnWriteAddressHeaderContents (XmlDictionaryWriter writer)
        {
            writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.LocalTransactionId,
                                     XD.DotNetAtomicTransactionExternalDictionary.Namespace);

            writer.WriteValue(this.transactionId);
            writer.WriteEndElement();

            if (this.contextId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.ContextId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.contextId);
                writer.WriteEndElement();
            }

            if (this.tokenId != null)
            {
                writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.TokenId,
                                         XD.DotNetAtomicTransactionExternalDictionary.Namespace);

                writer.WriteValue(this.tokenId);
                writer.WriteEndElement();
            }
        }
 internal static void WriteAckRanges(XmlDictionaryWriter writer, ReliableMessagingVersion reliableMessagingVersion, UniqueId sequenceId, SequenceRangeCollection ranges)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
     writer.WriteStartElement(dictionary.Identifier, namespaceUri);
     writer.WriteValue(sequenceId);
     writer.WriteEndElement();
     if (ranges.Count == 0)
     {
         if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
         {
             ranges = ranges.MergeWith((long) 0L);
         }
         else if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
         {
             writer.WriteStartElement(DXD.Wsrm11Dictionary.None, namespaceUri);
             writer.WriteEndElement();
         }
     }
     for (int i = 0; i < ranges.Count; i++)
     {
         writer.WriteStartElement(dictionary.AcknowledgementRange, namespaceUri);
         writer.WriteStartAttribute(dictionary.Lower, null);
         SequenceRange range = ranges[i];
         writer.WriteValue(range.Lower);
         writer.WriteEndAttribute();
         writer.WriteStartAttribute(dictionary.Upper, null);
         SequenceRange range2 = ranges[i];
         writer.WriteValue(range2.Upper);
         writer.WriteEndAttribute();
         writer.WriteEndElement();
     }
 }
 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(this.reliableMessagingVersion);
     writer.WriteStartElement(dictionary.CreateSequenceResponse, namespaceUri);
     writer.WriteStartElement(dictionary.Identifier, namespaceUri);
     writer.WriteValue(this.identifier);
     writer.WriteEndElement();
     if (this.expires.HasValue)
     {
         writer.WriteStartElement(dictionary.Expires, namespaceUri);
         writer.WriteValue(this.expires.Value);
         writer.WriteEndElement();
     }
     if (this.reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
     {
         Wsrm11Dictionary dictionary2 = DXD.Wsrm11Dictionary;
         writer.WriteStartElement(dictionary2.IncompleteSequenceBehavior, namespaceUri);
         writer.WriteValue(this.ordered ? dictionary2.DiscardFollowingFirstGap : dictionary2.NoDiscard);
         writer.WriteEndElement();
     }
     if (this.acceptAcksTo != null)
     {
         writer.WriteStartElement(dictionary.Accept, namespaceUri);
         this.acceptAcksTo.WriteTo(this.addressingVersion, writer, dictionary.AcksTo, namespaceUri);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
 protected override void OnWriteAddressHeaderContents(XmlDictionaryWriter writer)
 {
     if (this.protocol != ControlProtocol.None)
     {
         writer.WriteStartAttribute(XD.DotNetAtomicTransactionExternalDictionary.Protocol, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue((int) this.protocol);
         writer.WriteEndAttribute();
     }
     writer.WriteValue(this.enlistment);
 }
 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
     Wsrm11Dictionary dictionary = DXD.Wsrm11Dictionary;
     writer.WriteStartElement(dictionary.CloseSequence, namespaceUri);
     writer.WriteStartElement(XD.WsrmFeb2005Dictionary.Identifier, namespaceUri);
     writer.WriteValue(this.identifier);
     writer.WriteEndElement();
     if (this.lastMsgNumber > 0L)
     {
         writer.WriteStartElement(dictionary.LastMsgNumber, namespaceUri);
         writer.WriteValue(this.lastMsgNumber);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
            public void WriteJson(XmlDictionaryWriter writer)
            {
                writer.WriteStartElement(MetadataStrings.TypeString);
                writer.WriteAttributeString("type", "string");
                writer.WriteString(String.Format("{0}{1}{2}", this.TypeName, MetadataStrings.NamespaceMarker, this.TypeNamespace));
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.KeyString);
                writer.WriteAttributeString("type", "array");
                foreach (string keyitem in this.Key)
                {
                    writer.WriteStartElement("item");
                    writer.WriteAttributeString("type", "string");
                    writer.WriteValue(keyitem);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();

                writer.WriteStartElement(MetadataStrings.FieldsString);
                writer.WriteAttributeString("type", "object");
                foreach (TypePropertyMetadata field in this.Properties)
                {
                    field.WriteJson(writer);
                }
                writer.WriteEndElement();

                this.WriteValidationRulesMetadata(writer);
            }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
     writer.WriteStartElement(dictionary.Identifier, dictionaryNamespace);
     writer.WriteValue(this.sequenceID);
     writer.WriteEndElement();
     writer.WriteStartElement(dictionary.MessageNumber, dictionaryNamespace);
     writer.WriteValue(this.sequenceNumber);
     writer.WriteEndElement();
     if ((base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005) && this.lastMessage)
     {
         writer.WriteStartElement(dictionary.LastMessage, dictionaryNamespace);
         writer.WriteEndElement();
     }
 }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
     writer.WriteStartElement(dictionary.Identifier, dictionaryNamespace);
     writer.WriteValue(this.sequenceID);
     writer.WriteEndElement();
 }
 public override void WriteObjectContent(XmlDictionaryWriter writer, object graph)
 {
     var data = Serialize(graph);
     if (UseEncryption())
         data = Encrypt(data);
     var content = Convert.ToBase64String(data);
     writer.WriteValue(content);
 }
 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     XmlDictionaryString wsrmNs = WsrmIndex.GetNamespace(ReliableMessagingVersion.WSReliableMessaging11);
     writer.WriteStartElement(DXD.Wsrm11Dictionary.TerminateSequenceResponse, wsrmNs);
     writer.WriteStartElement(XD.WsrmFeb2005Dictionary.Identifier, wsrmNs);
     writer.WriteValue(this.identifier);
     writer.WriteEndElement();
     writer.WriteEndElement();
 }
 protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
 {
     ReliableMessagingVersion reliableMessagingVersion = base.GetReliableMessagingVersion();
     WsrmUtilities.WriteIdentifier(writer, reliableMessagingVersion, base.SequenceID);
     if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
     {
         writer.WriteStartElement("r", DXD.Wsrm11Dictionary.MaxMessageNumber, WsrmIndex.GetNamespace(reliableMessagingVersion));
         writer.WriteValue((long) 0x7fffffffffffffffL);
         writer.WriteEndElement();
     }
 }
Пример #12
0
 protected override void OnWriteHeaderContents(
     XmlDictionaryWriter writer,
     MessageVersion messageVersion)
 {
     if (null == writer) {
         throw new ArgumentNullException("writer");
     }
     writer.WriteStartElement("Property", this.Namespace);
     writer.WriteAttributeString("name", null, "instanceId");
     writer.WriteValue(Value);
     writer.WriteEndElement();
 }
        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();
        }
 public void WriteTo(XmlDictionaryWriter writer)
 {
     writer.WriteStartElement(this.coordinationStrings.Prefix, this.coordinationXmlDictionaryStrings.Register, this.coordinationXmlDictionaryStrings.Namespace);
     XmlDictionaryString str = WSAtomicTransactionStrings.ProtocolToWellKnownName(this.Protocol, this.protocolVersion);
     writer.WriteStartElement(this.coordinationXmlDictionaryStrings.Protocol, this.coordinationXmlDictionaryStrings.Namespace);
     writer.WriteString(str);
     writer.WriteEndElement();
     this.ParticipantProtocolService.WriteTo(MessagingVersionHelper.AddressingVersion(this.protocolVersion), writer, this.coordinationXmlDictionaryStrings.ParticipantProtocolService, this.coordinationXmlDictionaryStrings.Namespace);
     if (this.Loopback != Guid.Empty)
     {
         writer.WriteStartElement("mstx", XD.DotNetAtomicTransactionExternalDictionary.Loopback, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue(this.Loopback);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString dictionaryNamespace = this.DictionaryNamespace;
     WriteAckRanges(writer, base.ReliableMessagingVersion, this.sequenceID, this.ranges);
     if ((base.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && this.final)
     {
         writer.WriteStartElement(DXD.Wsrm11Dictionary.Final, dictionaryNamespace);
         writer.WriteEndElement();
     }
     if (this.bufferRemaining != -1)
     {
         writer.WriteStartElement("netrm", dictionary.BufferRemaining, XD.WsrmFeb2005Dictionary.NETNamespace);
         writer.WriteValue(this.bufferRemaining);
         writer.WriteEndElement();
     }
 }
Пример #16
0
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     if (writer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");
     }
     writer.WriteAttributeString("CorrelationId", _headerId.ToString());
     writer.WriteValue(_guid);
 }
Пример #17
0
 public void WriteValue(XmlDictionaryWriter writer, object value)
 {
     if (_isArray)
     {
         switch (_typeCode)
         {
             case TypeCode.Byte:
                 {
                     byte[] arrayValue = (byte[])value;
                     writer.WriteBase64(arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Boolean:
                 {
                     bool[] arrayValue = (bool[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.DateTime:
                 {
                     DateTime[] arrayValue = (DateTime[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Decimal:
                 {
                     decimal[] arrayValue = (decimal[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Int32:
                 {
                     Int32[] arrayValue = (Int32[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Int64:
                 {
                     Int64[] arrayValue = (Int64[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Single:
                 {
                     float[] arrayValue = (float[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             case TypeCode.Double:
                 {
                     double[] arrayValue = (double[])value;
                     writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
                 }
                 break;
             default:
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.SFxInvalidUseOfPrimitiveOperationFormatter));
         }
     }
     else
     {
         switch (_typeCode)
         {
             case TypeCode.Boolean:
                 writer.WriteValue((bool)value);
                 break;
             case TypeCode.DateTime:
                 writer.WriteValue((DateTime)value);
                 break;
             case TypeCode.Decimal:
                 writer.WriteValue((Decimal)value);
                 break;
             case TypeCode.Double:
                 writer.WriteValue((double)value);
                 break;
             case TypeCode.Int32:
                 writer.WriteValue((int)value);
                 break;
             case TypeCode.Int64:
                 writer.WriteValue((long)value);
                 break;
             case TypeCode.Single:
                 writer.WriteValue((float)value);
                 break;
             case TypeCode.String:
                 writer.WriteString((string)value);
                 break;
             default:
                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.SFxInvalidUseOfPrimitiveOperationFormatter));
         }
     }
 }
Пример #18
0
 private void SerializeParameter(XmlDictionaryWriter writer, PartInfo part, object graph)
 {
     writer.WriteStartElement(part.DictionaryName, part.DictionaryNamespace);
     if (graph == null)
     {
         writer.WriteStartAttribute(_xsiNilLocalName, _xsiNilNamespace);
         writer.WriteValue(true);
         writer.WriteEndAttribute();
     }
     else
         part.WriteValue(writer, graph);
     writer.WriteEndElement();
 }
Пример #19
0
 public static void WriteElementContentAsInt64(XmlDictionaryWriter writer, XmlDictionaryString localName, XmlDictionaryString ns, Int64 value)
 {
     writer.WriteStartElement(localName, ns);
     writer.WriteValue(value);
     writer.WriteEndElement();
 }
Пример #20
0
 public static void WriteElementStringAsUniqueId(XmlDictionaryWriter writer, XmlDictionaryString localName, XmlDictionaryString ns, string id)
 {
     writer.WriteStartElement(localName, ns);
     writer.WriteValue(id);
     writer.WriteEndElement();
 }
Пример #21
0
			protected override void OnWriteHeaderContents (XmlDictionaryWriter writer,
								       MessageVersion version)
			{
				// FIXME: it's a nasty workaround just to avoid UniqueId output as a string, for bug #577139.
				if (Value is UniqueId)
					writer.WriteValue ((UniqueId) Value);
				else
					this.formatter.WriteObjectContent (writer, value);
			}
Пример #22
0
 static public void WriteStringAsUniqueId(XmlDictionaryWriter writer, UniqueId id)
 {
     writer.WriteValue(id);
 }
Пример #23
0
 static public void WriteAttributeStringAsUniqueId(XmlDictionaryWriter writer, string prefix, XmlDictionaryString localName, XmlDictionaryString ns, UniqueId id)
 {
     writer.WriteStartAttribute(prefix, localName, ns);
     writer.WriteValue(id);
     writer.WriteEndAttribute();
 }
Пример #24
0
        // Methods of BodyWriter
        /// <summary>
        /// Writes out an XML representation of the instance.        
        /// </summary>
        /// <param name="writer">The writer to be used to write out the XML content</param>
        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            // Write out the wst:RequestSecurityToken start tag
            writer.WriteStartElement(Constants.Trust.Elements.RequestSecurityToken, Constants.Trust.NamespaceUri);

            // If we have a non-null, non-empty tokenType...
            if (this.TokenType != null && this.TokenType.Length > 0)
            {
                // Write out the wst:TokenType start tag
                writer.WriteStartElement(Constants.Trust.Elements.TokenType, Constants.Trust.NamespaceUri);
                // Write out the tokenType string
                writer.WriteString(this.TokenType);
                writer.WriteEndElement(); // wst:TokenType
            }

            // If we have a non-null, non-empty requestType...
            if (this.requestType != null && this.requestType.Length > 0)
            {
                // Write out the wst:RequestType start tag
                writer.WriteStartElement(Constants.Trust.Elements.RequestType, Constants.Trust.NamespaceUri);
                // Write out the requestType string
                writer.WriteString(this.requestType);
                writer.WriteEndElement(); // wst:RequestType
            }

            // If we have a non-null appliesTo
            if (this.AppliesTo != null)
            {
                // Write out the wsp:AppliesTo start tag
                writer.WriteStartElement(Constants.Policy.Elements.AppliesTo, Constants.Policy.NamespaceUri);
                // Write the appliesTo in WS-Addressing 1.0 format
                this.AppliesTo.WriteTo(AddressingVersion.WSAddressing10, writer);
                writer.WriteEndElement(); // wsp:AppliesTo
            }

            if (this.requestorEntropy!=null)
            {
                writer.WriteStartElement(Constants.Trust.Elements.Entropy, Constants.Trust.NamespaceUri);
                BinarySecretSecurityToken bsst = this.requestorEntropy as BinarySecretSecurityToken;
                if (bsst!=null)
                {
                    writer.WriteStartElement(Constants.Trust.Elements.BinarySecret, Constants.Trust.NamespaceUri);
                    byte[] key = bsst.GetKeyBytes();
                    writer.WriteBase64(key, 0, key.Length);
                    writer.WriteEndElement(); // wst:BinarySecret
                }
                writer.WriteEndElement(); // wst:Entropy
            }

            if (this.keyType != null && this.keyType.Length > 0)
            {
                writer.WriteStartElement(Constants.Trust.Elements.KeyType, Constants.Trust.NamespaceUri);
                writer.WriteString(this.keyType);
                writer.WriteEndElement(); // wst:KeyType
            }

            if (this.KeySize> 0)
            {
                writer.WriteStartElement(Constants.Trust.Elements.KeySize, Constants.Trust.NamespaceUri);
                writer.WriteValue(this.KeySize );
                writer.WriteEndElement(); // wst:KeySize
            }

            writer.WriteEndElement(); // wst:RequestSecurityToken
        }
Пример #25
0
 public override void WriteValue(object value)
 {
     writer.WriteValue(value);
 }
Пример #26
0
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     /*
     if ((object)relationship != (object)ReplyRelationshipType)
     {
         // The RelationshipType attribute has no namespace.
         writer.WriteStartAttribute(AddressingStrings.RelationshipType, AddressingStrings.Empty);
         writer.WriteString(relationship.AbsoluteUri);
         writer.WriteEndAttribute();
     }
     */
     writer.WriteValue(_messageId);
 }
Пример #27
0
			void WriteMessagePart (
				XmlDictionaryWriter writer, MessageBodyDescription desc, MessagePartDescription partDesc, object obj)
			{
				// FIXME: it seems TransferMode.Streamed* has different serialization than .Buffered. Need to differentiate serialization somewhere (not limited to here).
				if (partDesc.Type == typeof (Stream)) {
					writer.WriteStartElement (partDesc.Name, partDesc.Namespace);
					writer.WriteValue (new StreamProvider ((Stream) obj));
					writer.WriteEndElement ();
				}
				else
					parent.GetSerializer (partDesc).WriteObject (writer, obj);
			}
Пример #28
0
        public virtual void WriteXml(XmlDictionaryWriter writer, SamlSerializer samlSerializer, SecurityTokenSerializer keyInfoSerializer)
        {
            CheckObjectValidity();

            if (writer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("writer");

            if (samlSerializer == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("samlSerializer"));

#pragma warning suppress 56506 // samlSerializer.DictionaryManager is never null.
            SamlDictionary dictionary = samlSerializer.DictionaryManager.SamlDictionary;

            try
            {
                writer.WriteStartElement(dictionary.PreferredPrefix.Value, dictionary.Assertion, dictionary.Namespace);

                writer.WriteStartAttribute(dictionary.MajorVersion, null);
                writer.WriteValue(SamlConstants.MajorVersionValue);
                writer.WriteEndAttribute();
                writer.WriteStartAttribute(dictionary.MinorVersion, null);
                writer.WriteValue(SamlConstants.MinorVersionValue);
                writer.WriteEndAttribute();
                writer.WriteStartAttribute(dictionary.AssertionId, null);
                writer.WriteString(this.assertionId);
                writer.WriteEndAttribute();
                writer.WriteStartAttribute(dictionary.Issuer, null);
                writer.WriteString(this.issuer);
                writer.WriteEndAttribute();
                writer.WriteStartAttribute(dictionary.IssueInstant, null);
                writer.WriteString(this.issueInstant.ToString(SamlConstants.GeneratedDateTimeFormat, CultureInfo.InvariantCulture));
                writer.WriteEndAttribute();

                // Write out conditions
                if (this.conditions != null)
                {
                    this.conditions.WriteXml(writer, samlSerializer, keyInfoSerializer);
                }

                // Write out advice if there is one
                if (this.advice != null)
                {
                    this.advice.WriteXml(writer, samlSerializer, keyInfoSerializer);
                }

                for (int i = 0; i < this.statements.Count; i++)
                {
                    this.statements[i].WriteXml(writer, samlSerializer, keyInfoSerializer);
                }

                writer.WriteEndElement();
            }
            catch (Exception e)
            {
                // Always immediately rethrow fatal exceptions.
                if (Fx.IsFatal(e)) throw;

                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SAMLTokenNotSerialized), e));
            }
        }
Пример #29
0
 protected override void OnWriteHeaderContents(System.Xml.XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     //writer.WriteStartElement(this.Name, this.Namespace);
     writer.WriteValue(this.id);
     //writer.WriteEndElement();
 }
Пример #30
0
        protected override void OnWriteDetailContents(XmlDictionaryWriter writer)
        {
            ReliableMessagingVersion reliableMessagingVersion = this.GetReliableMessagingVersion();
            WsrmUtilities.WriteIdentifier(writer, reliableMessagingVersion, this.SequenceID);

            if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11)
            {
                writer.WriteStartElement(WsrmFeb2005Strings.Prefix, DXD.Wsrm11Dictionary.MaxMessageNumber,
                    WsrmIndex.GetNamespace(reliableMessagingVersion));
                writer.WriteValue(Int64.MaxValue);
                writer.WriteEndElement();
            }
        }
 public void WriteContent(XmlDictionaryWriter writer)
 {
     if ((this.isoLevel != System.Transactions.IsolationLevel.Unspecified) || (this.localTxId != Guid.Empty))
     {
         writer.WriteXmlnsAttribute("mstx", XD.DotNetAtomicTransactionExternalDictionary.Namespace);
     }
     writer.WriteStartElement(this.coordinationStrings.Prefix, this.coordinationXmlDictionaryStrings.Identifier, this.coordinationXmlDictionaryStrings.Namespace);
     if (this.unknownIdentifierAttributes != null)
     {
         foreach (System.Xml.XmlNode node in this.unknownIdentifierAttributes)
         {
             node.WriteTo(writer);
         }
     }
     writer.WriteString(this.contextId);
     writer.WriteEndElement();
     if (this.expiresPresent)
     {
         writer.WriteStartElement(this.coordinationXmlDictionaryStrings.Expires, this.coordinationXmlDictionaryStrings.Namespace);
         if (this.unknownExpiresAttributes != null)
         {
             foreach (System.Xml.XmlNode node2 in this.unknownExpiresAttributes)
             {
                 node2.WriteTo(writer);
             }
         }
         writer.WriteValue((long) this.expiration);
         writer.WriteEndElement();
     }
     writer.WriteStartElement(this.coordinationXmlDictionaryStrings.CoordinationType, this.coordinationXmlDictionaryStrings.Namespace);
     writer.WriteString(this.atomicTransactionXmlDictionaryStrings.Namespace);
     writer.WriteEndElement();
     this.registrationRef.WriteTo(MessagingVersionHelper.AddressingVersion(this.protocolVersion), writer, this.coordinationXmlDictionaryStrings.RegistrationService, this.coordinationXmlDictionaryStrings.Namespace);
     if (this.isoLevel != System.Transactions.IsolationLevel.Unspecified)
     {
         writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.IsolationLevel, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue((int) this.isoLevel);
         writer.WriteEndElement();
     }
     if (this.isoFlags != 0)
     {
         writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.IsolationFlags, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue((int) this.isoFlags);
         writer.WriteEndElement();
     }
     if (!string.IsNullOrEmpty(this.description))
     {
         writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.Description, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue(this.description);
         writer.WriteEndElement();
     }
     if (this.localTxId != Guid.Empty)
     {
         writer.WriteStartElement(XD.DotNetAtomicTransactionExternalDictionary.LocalTransactionId, XD.DotNetAtomicTransactionExternalDictionary.Namespace);
         writer.WriteValue(this.localTxId);
         writer.WriteEndElement();
     }
     if (this.propToken != null)
     {
         OleTxTransactionHeader.WritePropagationTokenElement(writer, this.propToken);
     }
     if (this.unknownData != null)
     {
         int count = this.unknownData.Count;
         for (int i = 0; i < count; i++)
         {
             this.unknownData[i].WriteTo(writer);
         }
     }
 }
 protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteValue(_value);
 }
Пример #33
0
 protected override void OnWriteHeaderContents(System.Xml.XmlDictionaryWriter writer, MessageVersion messageVersion)
 {
     writer.WriteValue(this.Version);
 }