コード例 #1
0
ファイル: TextMessageEncoder.cs プロジェクト: JianwenSun/cc
 protected override void OnWriteStartMessage(XmlDictionaryWriter writer)
 {
     if (!messageEncoder.optimizeWriteForUTF8)
         writer.WriteStartDocument();
 }
コード例 #2
0
ファイル: TextMessageEncoder.cs プロジェクト: JianwenSun/cc
                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);
                    }
                }
コード例 #3
0
 public override void WriteStartDocument()
 {
     writer.WriteStartDocument();
 }
コード例 #4
0
 protected override void OnWriteStartMessage(XmlDictionaryWriter writer)
 {
     writer.WriteStartDocument();
 }
コード例 #5
0
 protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
 {
     writer.WriteStartDocument();
     var serializer = new XmlSerializer(_typeToSerialize);
     serializer.Serialize(writer, _objectToEncode);
     writer.WriteEndDocument();
 }