分离玩家信息插件,以及更新检测

This commit is contained in:
2021-10-22 08:54:04 +02:00
parent 2a96f8efac
commit 08700abd4f
25 changed files with 860 additions and 234 deletions

29
Utils/WpfExtensions.cs Normal file
View File

@@ -0,0 +1,29 @@
using System.Collections.Generic;
using System.Windows;
namespace AnotherReplayReader.Utils
{
internal static class WpfExtensions
{
public static IEnumerable<T> FindVisualChildren<T>(this DependencyObject depObj) where T : DependencyObject
{
foreach (var x in LogicalTreeHelper.GetChildren(depObj))
{
if (x is not DependencyObject child)
{
continue;
}
if (child is T tchild)
{
yield return tchild;
}
foreach (var childOfChild in FindVisualChildren<T>(child))
{
yield return childOfChild;
}
}
}
}
}