Esempio n. 1
0
 private void WriteStreamCompletionMessage(StreamCompletionMessage message, JsonTextWriter writer)
 {
     writer.WriteStartObject();
     WriteHubMessageCommon(message, writer, StreamCompletionMessageType);
     if (!string.IsNullOrEmpty(message.Error))
     {
         writer.WritePropertyName(ErrorPropertyName);
         writer.WriteValue(message.Error);
     }
     writer.WriteEndObject();
 }
        private void WriteStreamCompletionMessage(StreamCompletionMessage streamCompletionMessage, Packer packer)
        {
            var hasError = !string.IsNullOrEmpty(streamCompletionMessage.Error);

            packer.PackArrayHeader(2 + (hasError ? 1 : 0));

            packer.Pack(StreamCompletionMessageType);
            packer.PackString(streamCompletionMessage.InvocationId);
            if (hasError)
            {
                packer.PackString(streamCompletionMessage.Error);
            }
        }