/// <summary> /// Send a <see cref="XenMessage"/> to the design server. /// The message is serialized to JSON before sending. /// </summary> /// <param name="message"></param> public virtual void Send(XenMessage message) { if (string.IsNullOrWhiteSpace(message.MessageId)) { message.MessageId = Guid.NewGuid().ToString(); } SendImplementation(message.ToJson()); }
/// <summary> /// Send the <paramref name="message"/> to the appropriate <see cref="ToolboxAction"/> for execution. /// </summary> /// <param name="message"></param> /// <param name="next">Callback executed if this message has a <see cref="XenMessage.NextSuggestedMessage"/></param> /// <returns> /// True if the message was executed; otherwise, false. /// </returns> public bool Queue(XenMessage message, Action <XenMessage> next = null) { return(Queue(message?.ToJson(), next)); }