Beispiel #1
0
        /// <summary>
        /// 获取朋友消息列表
        /// </summary>
        /// <param name="listBox"></param>
        public static void GetFriendsMessage(ref ListBox listBox)
        {
            listBox.Items.Clear();

            List <TFriendMessage> listMsg = BLLControl.GetFriendMessage();

            listBox.Tag = listMsg;



            foreach (TFriendMessage msg in listMsg)
            {
                DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)).AddSeconds(msg.OperateTime);
                string   sItem   = dtStart.ToShortDateString() + " " + dtStart.ToShortTimeString() + "  " + msg.FromVssID;
                if (msg.Operate == TFriendOperate.Add)
                {
                    if (msg.LinkNum == 0)
                    {
                        sItem += " Ask You to be Friend . ";
                    }
                    else //LinkNum == 1
                    {
                        sItem += " Accept Your Friend Invite . ";
                    }
                }
                else
                {
                    if (msg.LinkNum == 1)
                    {
                        sItem += " Disable the Friend Invite . ";
                    }
                    else //LinkNum == 2
                    {
                        sItem += " Stop Your Friendship . ";
                    }
                }
                listBox.Items.Add(sItem);
            }
        }