-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增强制搜索已删除人员(从消息库搜索)
- Loading branch information
Showing
9 changed files
with
245 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Window x:Class="WechatPCMsgBakTool.Analyse" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:WechatPCMsgBakTool" | ||
mc:Ignorable="d" | ||
WindowStartupLocation="CenterScreen" | ||
Title="溯雪微信备份工具-分析" Height="450" Width="900"> | ||
<Grid> | ||
<ListView Name="list_msg_group" Margin="41,75,0,19" HorizontalAlignment="Left" Width="420" SelectionChanged="list_msg_group_SelectionChanged"> | ||
<ListView.View> | ||
<GridView> | ||
<GridViewColumn Header="昵称" Width="120" DisplayMemberBinding="{Binding NickName}" /> | ||
<GridViewColumn Header="原始ID" Width="120" DisplayMemberBinding="{Binding UserName}" /> | ||
<GridViewColumn Header="数量" Width="140" DisplayMemberBinding="{Binding MsgCount}" /> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
<Button x:Name="btn_analyse" Content="分析" HorizontalAlignment="Left" Margin="42,43,0,0" VerticalAlignment="Top" Width="72" Click="btn_analyse_Click"/> | ||
<Button x:Name="btn_copy_id" Content="复制id" HorizontalAlignment="Left" Margin="366,43,0,0" VerticalAlignment="Top" Width="94" Click="btn_copy_id_Click"/> | ||
|
||
<ListView Name="list_msg_search" Margin="500,75,0,19" HorizontalAlignment="Left" Width="350"> | ||
<ListView.View> | ||
<GridView> | ||
<GridViewColumn Header="原始ID" Width="120" DisplayMemberBinding="{Binding StrTalker}" /> | ||
<GridViewColumn Header="消息" Width="200" DisplayMemberBinding="{Binding StrContent}" /> | ||
</GridView> | ||
</ListView.View> | ||
</ListView> | ||
<TextBox Name="txt_search_text" HorizontalAlignment="Left" Margin="574,43,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120" Height="20"/> | ||
<Label Content="消息搜索:" HorizontalAlignment="Left" Margin="504,41,0,0" VerticalAlignment="Top"/> | ||
<Button x:Name="btn_search" Content="搜索" HorizontalAlignment="Left" Margin="708,43,0,0" VerticalAlignment="Top" Width="65" Click="btn_search_Click" /> | ||
<Button x:Name="btn_search_copy_id" Content="复制id" HorizontalAlignment="Left" Margin="784,43,0,0" VerticalAlignment="Top" Width="65" Click="btn_search_copy_id_Click" /> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
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 WechatPCMsgBakTool.Model; | ||
|
||
namespace WechatPCMsgBakTool | ||
{ | ||
/// <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) | ||
{ | ||
List<WXContact>? contacts = UserReader.GetWXContacts(); | ||
List<WXMsgGroup> list = UserReader.GetWXMsgGroup().OrderByDescending(x => x.MsgCount).ToList(); | ||
if(contacts == null) | ||
contacts = new List<WXContact>(); | ||
|
||
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters