示例#1
0
 public Friend()
 {
     this.strJID = null;
     this.strNick = null;
     this.enuSubscriptionType = agsXMPP.protocol.iq.roster.SubscriptionType.none;
     this.nStatus = 0;
     this.listGroup = new List<string>();
 }
示例#2
0
            private bool ParseNode(XmlNode friend)
            {
                if (friend == null)
                {
                    return false; 
                }

                if (this.listGroup == null)
                {
                    this.listGroup = new List<string>();
                }
                else
                {
                    this.listGroup.Clear();
                }

                foreach (XmlNode groupItem in friend.SelectSingleNode("Group").ChildNodes)
                {
                    this.listGroup.Add(groupItem.InnerText);
                }

                XmlNode nickName = friend.SelectSingleNode("Nick");
                if (nickName != null)
                {
                    this.strNick = nickName.InnerText;
                }
                
                XmlNode jid = friend.SelectSingleNode("JID");
                if(jid != null)
                {
                    this.strJID = jid.InnerText;
                }
                
                XmlNode subscribe = friend.SelectSingleNode("Subscribe");
                if (subscribe != null)
                {
                    XmlNode subscribeType = subscribe.SelectSingleNode("Type");
                    if (subscribeType != null)
                    {
                        this.enuSubscriptionType = (SubscriptionType)Enum.Parse(typeof(SubscriptionType), subscribeType.InnerText);
                    }

                    XmlNode subscribeStatus = subscribe.SelectSingleNode("Status");
                    if (subscribeStatus != null)
                    {
                        this.nStatus = int.Parse(subscribeStatus.InnerText);
                    }
                }

                return true;

            }