コード例 #1
0
 private static void WriteInvocationId(HubInvocationMessage message, JsonTextWriter writer)
 {
     if (!string.IsNullOrEmpty(message.InvocationId))
     {
         writer.WritePropertyName(InvocationIdPropertyName);
         writer.WriteValue(message.InvocationId);
     }
 }
コード例 #2
0
 private static void WriteHubInvocationMessageCommon(HubInvocationMessage message, JsonTextWriter writer, int type)
 {
     if (!string.IsNullOrEmpty(message.InvocationId))
     {
         writer.WritePropertyName(InvocationIdPropertyName);
         writer.WriteValue(message.InvocationId);
     }
     WriteMessageType(writer, type);
 }
コード例 #3
0
 private void WriteHeaders(JsonTextWriter writer, HubInvocationMessage message)
 {
     if (message.Headers != null && message.Headers.Count > 0)
     {
         writer.WritePropertyName(HeadersPropertyName);
         writer.WriteStartObject();
         foreach (var value in message.Headers)
         {
             writer.WritePropertyName(value.Key);
             writer.WriteValue(value.Value);
         }
         writer.WriteEndObject();
     }
 }