jabber.connection.PubSubNode.AddItemAddCallback C# (CSharp) Method

AddItemAddCallback() public method

Adds a handler for the OnItemAdd event, and calls the handler for any existing items. To prevent races, use this rather than .OnItemAdd +=.
public AddItemAddCallback ( ItemCB callback ) : void
callback ItemCB Callback to call with every item.
return void
        public void AddItemAddCallback(ItemCB callback)
        {
            if (callback == null)
                throw new ArgumentException("Must not be null", "callback");

            OnItemAdd += callback;
            foreach (PubSubItem item in m_items)
            {
                callback(this, item);
            }
        }