Beispiel #1
0
 /// <summary>
 /// Get all Lists
 /// </summary>
 /// <returns>Array of all privacy lists</returns>
 public List[] GetList()
 {
     ElementList el = SelectElements(typeof(List));
     int i = 0;
     List[] result = new List[el.Count];
     foreach (List list in el)
     {
         result[i] = list;
         i++;
     }
     return result;
 }
        /// <summary>
        /// Update the list with the given name and rules.
        /// </summary>
        /// <remarks>
        /// Specify the desired changes to the list by including all elements/rules in the list 
        /// (not the "delta")
        /// </remarks>
        /// <param name="name">name of this list</param>
        /// <param name="rules">rules of this list</param>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void UpdateList(string name, Item[] rules, IqCB cb, object cbArg)
        {
            PrivacyIq pIq = new PrivacyIq();
            pIq.Type = XMPPProtocol.Protocol.client.IqType.set;

            // create a new list with the given name
            List list = new List(name);
            list.AddItems(rules);
            // add the list to the query
            pIq.Query.AddList(list);

            SendStanza(pIq, cb, cbArg);
        }
Beispiel #3
0
 /// <summary>
 /// Add a provacy list
 /// </summary>
 /// <param name="list"></param>
 public void AddList(List list)
 {
     this.AddChild(list);
 }