v1.15 — PowerShell edition + repo restructure
- New powershell/InstaSoftOfficeTool.ps1: single-file WPF GUI version - Same Fluent Design UI, no compilation needed - Runs on any Windows 7+ with PowerShell 5.1 (built-in) - Chrome won't flag .ps1 files as "rarely downloaded" - Auto-elevates to admin - Moved C# source to src/ subfolder - Updated .gitignore for nested bin/obj folders Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,75 +0,0 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace InstaSoftOfficeTool.Pages
|
||||
{
|
||||
public partial class ConfirmDialog : UserControl
|
||||
{
|
||||
private TaskCompletionSource<bool> _tcs;
|
||||
|
||||
public ConfirmDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public Task<bool> ShowAsync(string title, string message,
|
||||
string confirmText = "Igen", string cancelText = "M\u00e9gse",
|
||||
DialogType type = DialogType.Warning)
|
||||
{
|
||||
DialogTitle.Text = title;
|
||||
DialogMessage.Text = message;
|
||||
BtnConfirm.Content = confirmText;
|
||||
BtnCancel.Content = cancelText;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DialogType.Warning:
|
||||
DialogIcon.Text = "\uE7BA";
|
||||
DialogIcon.Foreground = (Brush)FindResource("WarningBrush");
|
||||
break;
|
||||
case DialogType.Question:
|
||||
DialogIcon.Text = "\uE9CE";
|
||||
DialogIcon.Foreground = (Brush)FindResource("AccentBrush");
|
||||
break;
|
||||
case DialogType.Error:
|
||||
DialogIcon.Text = "\uE711";
|
||||
DialogIcon.Foreground = (Brush)FindResource("ErrorBrush");
|
||||
break;
|
||||
}
|
||||
|
||||
Visibility = Visibility.Visible;
|
||||
_tcs = new TaskCompletionSource<bool>();
|
||||
return _tcs.Task;
|
||||
}
|
||||
|
||||
private void BtnConfirm_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Visibility = Visibility.Collapsed;
|
||||
_tcs?.TrySetResult(true);
|
||||
}
|
||||
|
||||
private void BtnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Visibility = Visibility.Collapsed;
|
||||
_tcs?.TrySetResult(false);
|
||||
}
|
||||
|
||||
private void Backdrop_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
// click outside = cancel
|
||||
Visibility = Visibility.Collapsed;
|
||||
_tcs?.TrySetResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
public enum DialogType
|
||||
{
|
||||
Warning,
|
||||
Question,
|
||||
Error
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user