Example #1
0
 protected override void OnWriteStartMessage(XmlDictionaryWriter writer)
 {
     if (!messageEncoder.optimizeWriteForUTF8)
         writer.WriteStartDocument();
 }
Example #2
0
                public WriteMessageAsyncResult(Message message, Stream stream, TextMessageEncoder textEncoder, AsyncCallback callback, object state)
                    : base(callback, state)
                {
                    this.message = message;                    
                    this.textEncoder = textEncoder;
                    this.xmlWriter = textEncoder.TakeStreamedWriter(stream);


                    this.eventTraceActivity = null;
                    if (TD.TextMessageEncodingStartIsEnabled())
                    {
                        this.eventTraceActivity = EventTraceActivityHelper.TryExtractActivity(message);
                        TD.TextMessageEncodingStart(this.eventTraceActivity);
                    }

                    if (!textEncoder.optimizeWriteForUTF8)
                    {
                        xmlWriter.WriteStartDocument();
                    }

                    IAsyncResult result = message.BeginWriteMessage(this.xmlWriter, PrepareAsyncCompletion(onWriteMessage), this);                    
                    if (SyncContinue(result))
                    {
                        this.Complete(true);
                    }
                }
Example #3
0
 public override void WriteStartDocument()
 {
     writer.WriteStartDocument();
 }
 protected override void OnWriteStartMessage(XmlDictionaryWriter writer)
 {
     writer.WriteStartDocument();
 }
 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartDocument();
     var serializer = new XmlSerializer(_typeToSerialize);
     serializer.Serialize(writer, _objectToEncode);
     writer.WriteEndDocument();
 }