Files
Ramitta-lib/template/MainWindow.xaml.cs

85 lines
2.4 KiB
C#
Raw Normal View History

2025-08-29 14:57:55 +08:00
using Ramitta;
using static Ramitta.lib.Basic;
using Newtonsoft.Json.Linq;
using System.Diagnostics;
using System.Text;
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.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
namespace template
{
public partial class MainWindow : Window
{
static string? filePath;
private JToken? _currentJsonData = null;
private string? _currentFilePath = null;
#region MainWindow
public MainWindow(StartupEventArgs e)
{
Startupe = ParseCommandLineArgs(e.Args);
InitializeComponent();
if (Startupe.TryGetValue("getfile", out string filePath))
{
MainWindow.filePath = filePath;
DebugBar(Debugtag, $"操作目标:{filePath}", 绿);
}
else
{
DebugBar(Debugtag, $"未指定操作目标", );
}
}
#endregion
private void (object sender, RoutedEventArgs e)
{
var stable = TreeList.AddLabelNode("GROUP");
TreeList.AddCheckboxNode("A");
TreeList.AddCheckboxNode("B", parent: stable);
TreeList.AddCheckboxNode("C");
_ = Dispatcher.BeginInvoke(new Action(() =>
{
TreeList.Find<CheckboxTreeNode, CheckBox>(null, "A");
TreeList.Find<CheckboxTreeNode, CheckBox>(null, "B");
TreeList.Find<CheckboxTreeNode, CheckBox>(null, "C");
}), DispatcherPriority.Loaded);
}
private void (object sender, RoutedEventArgs e)
{
}
private void (object sender, RoutedEventArgs e)
{
}
private void (object sender, RoutedEventArgs e)
{
List<TreeNode> val = TreeList.FindAllTreeNodes(TreeList.Nodes, "A", typeof(LabelTreeNode));
if (val.Count > 0)
{
DebugBar(Debugtag, $"{val.Count} 信息: {val[0].Text}", );
}
else
{
DebugBar(Debugtag, "没有找到任何相关信息", 绿);
}
}
}
}