Exemplo n.º 1
0
        /// <summary>
        /// 点击会话
        /// </summary>
        /// <param name="box">会话控件</param>
        private void click(SessionBox box = null)
        {
            if (id == null)
            {
                id = sessions.OrderBy(i => i.time).Last().id;
            }

            var control = (SessionBox)sceMain.Controls[0].Controls[id];

            if (control == null)
            {
                return;
            }

            control.BackColor = sceMain.Controls[0].BackColor;
            control.Refresh();
            if (box == null)
            {
                box = control;
            }

            box.unRead    = false;
            box.BackColor = Color.White;
            box.Refresh();

            id = box.Name;
            var session = sessions.Find(i => i.id == id);

            session.unRead = false;

            SessionAPI.SetUnreadCountZero(NIMSessionType.kNIMSessionTypeP2P, id, (a, b, c) => { });
            MessagelogAPI.MarkMessagesStatusRead(id, NIMSessionType.kNIMSessionTypeP2P, (a, b, c) => { });
        }