private void WriteCloseMessage(CloseMessage message, JsonTextWriter writer) { if (!string.IsNullOrEmpty(message.Error)) { writer.WritePropertyName(ErrorPropertyName); writer.WriteValue(message.Error); } }
private void WriteCloseMessage(CloseMessage message, JsonTextWriter writer) { if (message.Error != null) { writer.WritePropertyName(ErrorPropertyName); writer.WriteValue(message.Error); } }
private CloseMessage BindCloseMessage(string error) { if (string.IsNullOrEmpty(error)) { return(CloseMessage.Empty); } var message = new CloseMessage(error); return(message); }
private CloseMessage BindCloseMessage(string error) { // An empty string is still an error if (error == null) { return(CloseMessage.Empty); } var message = new CloseMessage(error); return(message); }
private void WriteCloseMessage(CloseMessage message, Packer packer) { packer.PackArrayHeader(2); packer.Pack(HubProtocolConstants.CloseMessageType); if (string.IsNullOrEmpty(message.Error)) { packer.PackNull(); } else { packer.PackString(message.Error); } }