代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/WechatBakTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WechatBakTool.Model;
namespace WechatBakTool
{
/// <summary>
/// Analyse.xaml 的交互逻辑
/// </summary>
public partial class Analyse : Window
{
private UserBakConfig UserBakConfig;
private WXUserReader UserReader;
public Analyse(UserBakConfig userBakConfig,WXUserReader reader)
{
UserBakConfig = userBakConfig;
UserReader = reader;
InitializeComponent();
}
private void btn_analyse_Click(object sender, RoutedEventArgs e)
{
var tmp = UserReader.GetWXContacts();
List<WXContact> contacts;
if (tmp == null)
contacts = new List<WXContact>();
else
contacts = tmp.ToList();
List<WXMsgGroup> list = UserReader.GetWXMsgGroup().OrderByDescending(x => x.MsgCount).ToList();
foreach (WXMsgGroup item in list)
{
WXContact? contact = contacts.Find(x => x.UserName == item.UserName);
if (contact != null)
{
item.NickName = contact.NickName;
}
else
item.NickName = "已删除人员:" + item.UserName;
}
list_msg_group.ItemsSource = list;
}
private void btn_copy_id_Click(object sender, RoutedEventArgs e)
{
WXMsgGroup? msgGroup = list_msg_group.SelectedItem as WXMsgGroup;
if(msgGroup == null)
{
MessageBox.Show("请先选择数据");
return;
}
else
{
Clipboard.SetDataObject(msgGroup.UserName);
}
}
private void list_msg_group_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
WXMsgGroup? wXMsgGroup = list_msg_group.SelectedItem as WXMsgGroup;
if(wXMsgGroup != null)
{
List<WXMsg>? wXMsgs = UserReader.GetWXMsgs(wXMsgGroup.UserName);
if(wXMsgs != null)
{
wXMsgs = wXMsgs.OrderByDescending(x => x.CreateTime).ToList();
list_msg_search.ItemsSource = wXMsgs;
}
}
}
private void btn_search_Click(object sender, RoutedEventArgs e)
{
List<WXMsg>? wXMsgs = UserReader.GetWXMsgs("",txt_search_text.Text);
if (wXMsgs != null)
{
wXMsgs = wXMsgs.OrderByDescending(x => x.CreateTime).ToList();
list_msg_search.ItemsSource = wXMsgs;
}
}
private void btn_search_copy_id_Click(object sender, RoutedEventArgs e)
{
WXMsg? wxMsg = list_msg_search.SelectedItem as WXMsg;
if (wxMsg == null)
{
MessageBox.Show("请先选择数据");
return;
}
else
{
Clipboard.SetDataObject(wxMsg.StrTalker);
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。