Пример #1
0
        /// <summary>
        /// 聊天记录点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void fListView1_ItemClick(object sender, WinForm.UI.Events.ItemClickEventArgs e)
        {
            WeChatMessage msg = e.ViewHolder.UserData as WeChatMessage;

            if (msg.MsgType == 3)//图片消息
            {
                string path = string.Empty;
                //TODO 获取图片
                ImageForm form = new ImageForm();
                form.Show(path);
            }
            else if (msg.MsgType == 34)//语音消息
            {
                string path = msg.fileName;
                adapter.Play();
                AsyncTask.StartNew(() =>
                {
                    Thread.Sleep((int)msg.VoiceLength / 1000);
                    adapter.Stop();
                });
            }
        }