/// <summary> /// Publishes an item on a node. /// </summary> /// <param name="PersonalEvent">Personal event.</param> /// <param name="Callback">Method to call when operation completes.</param> /// <param name="State">State object to pass on to callback method.</param> public void Publish(IPersonalEvent PersonalEvent, ItemResultEventHandler Callback, object State) { string ItemId = PersonalEvent.ItemId; if (ItemId is null) { this.pubSubClient?.Publish(string.Empty, PersonalEvent.Node, string.Empty, PersonalEvent.PayloadXml, Callback, State); } else { this.pubSubClient?.Publish(string.Empty, PersonalEvent.Node, ItemId, PersonalEvent.PayloadXml, Callback, State); } }
/// <summary> /// Publishes an item on a node. /// </summary> /// <param name="Node">Node name.</param> /// <param name="ItemId">Item identity, if available. If used, and an existing item /// is available with that identity, it will be updated with the new content.</param> /// <param name="PayloadXml">Payload XML.</param> /// <param name="Callback">Method to call when operation completes.</param> /// <param name="State">State object to pass on to callback method.</param> public void Publish(string Node, string ItemId, string PayloadXml, ItemResultEventHandler Callback, object State) { this.pubSubClient?.Publish(string.Empty, Node, ItemId, PayloadXml, Callback, State); }