void WriteAddressingProperties(XmlWriter dictionaryWriter) { Fx.Assert(this.message != null, ""); object property; if (this.message.Properties.TryGetValue(AddressingProperty.Name, out property)) { AddressingProperty addressingProperty = (AddressingProperty)property; dictionaryWriter.WriteStartElement(MessageLogTraceRecord.AddressingElementName); dictionaryWriter.WriteElementString(AddressingStrings.Action, addressingProperty.Action); if (null != addressingProperty.ReplyTo) { dictionaryWriter.WriteElementString(AddressingStrings.ReplyTo, addressingProperty.ReplyTo.ToString()); } if (null != addressingProperty.To) { dictionaryWriter.WriteElementString(AddressingStrings.To, addressingProperty.To.AbsoluteUri); } if (null != addressingProperty.MessageId) { dictionaryWriter.WriteElementString(AddressingStrings.MessageId, addressingProperty.MessageId.ToString()); } dictionaryWriter.WriteEndElement(); // Addressing message.Properties.Remove(AddressingProperty.Name); } }
private void WriteAddressingProperties(XmlWriter dictionaryWriter) { object obj2; if (this.message.Properties.TryGetValue(AddressingProperty.Name, out obj2)) { AddressingProperty property = (AddressingProperty)obj2; dictionaryWriter.WriteStartElement("Addressing"); dictionaryWriter.WriteElementString("Action", property.Action); if (null != property.ReplyTo) { dictionaryWriter.WriteElementString("ReplyTo", property.ReplyTo.ToString()); } if (null != property.To) { dictionaryWriter.WriteElementString("To", property.To.AbsoluteUri); } if (null != property.MessageId) { dictionaryWriter.WriteElementString("MessageID", property.MessageId.ToString()); } dictionaryWriter.WriteEndElement(); this.message.Properties.Remove(AddressingProperty.Name); } }