From fca54414e69e2b5a6911fb3f85d16dc24d421e85 Mon Sep 17 00:00:00 2001 From: wangjialiang Date: Fri, 28 Nov 2025 14:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.xaml | 16 +++ App.xaml.cs | 14 +++ AssemblyInfo.cs | 10 ++ FolderHelper.cs | 31 +++++ MainWindow.xaml | 49 ++++++++ MainWindow.xaml.cs | 280 +++++++++++++++++++++++++++++++++++++++++++ SelectCamera.xaml | 34 ++++++ SelectCamera.xaml.cs | 73 +++++++++++ TimedCapture.xaml | 44 +++++++ TimedCapture.xaml.cs | 133 ++++++++++++++++++++ WpfApp1.csproj | 25 ++++ WpfApp1.slnx | 9 ++ 12 files changed, 718 insertions(+) create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 AssemblyInfo.cs create mode 100644 FolderHelper.cs create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 SelectCamera.xaml create mode 100644 SelectCamera.xaml.cs create mode 100644 TimedCapture.xaml create mode 100644 TimedCapture.xaml.cs create mode 100644 WpfApp1.csproj create mode 100644 WpfApp1.slnx diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..bba105a --- /dev/null +++ b/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..4cd4cdb --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,14 @@ +using System.Configuration; +using System.Data; +using System.Windows; + +namespace WpfApp1 +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } + +} diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/FolderHelper.cs b/FolderHelper.cs new file mode 100644 index 0000000..7a8072a --- /dev/null +++ b/FolderHelper.cs @@ -0,0 +1,31 @@ +using Microsoft.WindowsAPICodePack.Dialogs; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WpfApp1 +{ + public static class FolderHelper + { + /// + /// 打开目录选择对话框,返回选择的路径。取消则返回 null。 + /// + public static string? SelectFolder(string title = "请选择保存目录") + { + var dialog = new CommonOpenFileDialog + { + IsFolderPicker = true, + Title = title + }; + + if (dialog.ShowDialog() == CommonFileDialogResult.Ok) + { + return dialog.FileName; + } + + return null; + } + } +} diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..0748c48 --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + +