示例#1
0
 public RosterItem[] GetRoster()
 {
     ElementList nl = SelectElements(typeof(RosterItem));
     int i = 0;
     RosterItem[] result = new RosterItem[nl.Count];
     foreach (RosterItem ri in nl)
     {
         result[i] = (RosterItem) ri;
         i++;
     }
     return result;
 }
示例#2
0
        /// <summary>
        /// Add a Rosteritem to the Roster
        /// </summary>
        /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
        /// <param name="nickname">Nickname for the RosterItem</param>
        /// <param name="group">An Array of groups when you want to add the Rosteritem to multiple groups</param>
        public void AddRosterItem(Jid jid, string nickname, string[] group)
        {
            RosterIq riq = new RosterIq();
            riq.Type = IqType.set;

            RosterItem ri = new RosterItem();
            ri.Jid	= jid;

            if (nickname != null)
                ri.Name	= nickname;

            foreach (string g in group)
            {
                ri.AddGroup(g);
            }

            riq.Query.AddRosterItem(ri);

            m_connection.Send(riq);
        }
示例#3
0
        /// <summary>
        /// Add a Rosteritem to the Roster
        /// </summary>
        /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
        /// <param name="nickname">Nickname for the RosterItem</param>
        /// <param name="group">An Array of groups when you want to add the Rosteritem to multiple groups</param>
        public void AddRosterItem(Jid jid, string nickname, string[] group)
        {
            RosterIq riq = new RosterIq();

            riq.Type = IqType.set;

            RosterItem ri = new RosterItem();

            ri.Jid = jid;

            if (nickname != null)
            {
                ri.Name = nickname;
            }

            foreach (string g in group)
            {
                ri.AddGroup(g);
            }

            riq.Query.AddRosterItem(ri);

            m_connection.Send(riq);
        }
示例#4
0
 public void AddRosterItem(RosterItem r)
 {
     this.ChildNodes.Add(r);
 }
示例#5
0
 public void AddRosterItem(RosterItem r)
 {
     this.ChildNodes.Add(r);
 }
示例#6
0
        /// <summary>
        /// Removes a Rosteritem from the Roster
        /// </summary>
        /// <param name="jid">The BARE jid of the rosteritem that should be removed</param>
        public void RemoveRosterItem(Jid jid)
        {
            RosterIq riq = new RosterIq();
            riq.Type = IqType.set;

            RosterItem ri = new RosterItem();
            ri.Jid = jid;
            ri.Subscription = SubscriptionType.remove;

            riq.Query.AddRosterItem(ri);

            m_connection.Send(riq);
        }