Example #1
0
        /// <summary>
        /// Publishes an item to the node.
        /// </summary>
        /// <param name="id">If null, the server will assign an item ID.</param>
        /// <param name="contents">The XML inside the item.  Should be in a new namespace.</param>
        public void PublishItem(string id, XmlElement contents)
        {
            PubSubIQ   iq   = createCommand(PubSubCommandType.publish);
            Publish    pub  = (Publish)iq.Command;
            PubSubItem item = new PubSubItem(m_stream.Document);

            if (id != null)
            {
                item.ID = id;
            }
            item.AddChild(contents);
            pub.AddChild(item);
            BeginIQ(iq, new IqCB(OnPublished), item);
        }
Example #2
0
 /// <summary>
 /// Publishes an item to the node.
 /// </summary>
 /// <param name="id">If null, the server will assign an item ID.</param>
 /// <param name="contents">The XML inside the item.  Should be in a new namespace.</param>
 public void PublishItem(string id, XmlElement contents)
 {
     PubSubIQ iq = createCommand(PubSubCommandType.publish);
     Publish pub = (Publish)iq.Command;
     PubSubItem item = new PubSubItem(m_stream.Document);
     if (id != null)
         item.ID = id;
     item.AddChild(contents);
     pub.AddChild(item);
     BeginIQ(iq, new IqCB(OnPublished), item);
 }