RemoveId() public method

Removes the item with the given ID. No exception is thrown if no item is found with that ID.
public RemoveId ( string id ) : void
id string ID of the item to remove
return void
Example #1
0
        private void m_stream_OnProtocol(object sender, XmlElement rp)
        {
            if (rp.Name != "message")
            {
                return;
            }
            PubSubEvent evt = rp["event", URI.PUBSUB_EVENT] as PubSubEvent;

            if (evt == null)
            {
                return;
            }

            EventItems items = evt.GetChildElement <EventItems>();

            if (items == null)
            {
                return;
            }
            if (items.Node != m_node)
            {
                return;
            }

            // OK, it's for us.  Might be a new one or a retraction.
            // Shrug, even if we're sent a mix, it shouldn't hurt anything.

            /*
             * <message from='pubsub.shakespeare.lit' to='*****@*****.**' id='bar'>
             * <event xmlns='http://jabber.org/protocol/pubsub#event'>
             *  <items node='princely_musings'>
             *    <retract id='ae890ac52d0df67ed7cfdf51b644e901'/>
             *  </items>
             * </event>
             * </message>
             */
            foreach (string id in items.GetRetractions())
            {
                m_items.RemoveId(id);
            }

            foreach (PubSubItem item in items.GetItems())
            {
                m_items.Add(item);
            }
        }
Example #2
0
        internal void FireItems(EventItems items)
        {
            // OK, it's for us.  Might be a new one or a retraction.
            // Shrug, even if we're sent a mix, it shouldn't hurt anything.

            /*
             * <message from='pubsub.shakespeare.lit' to='*****@*****.**' id='bar'>
             * <event xmlns='http://jabber.org/protocol/pubsub#event'>
             *  <items node='princely_musings'>
             *    <retract id='ae890ac52d0df67ed7cfdf51b644e901'/>
             *  </items>
             * </event>
             * </message>
             */
            foreach (string id in items.GetRetractions())
            {
                m_items.RemoveId(id);
            }

            foreach (PubSubItem item in items.GetItems())
            {
                m_items.Add(item);
            }
        }