port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
namespace Intromat.Views
{
/// <summary>
/// Interaction logic for UserInputWindow.xaml
/// </summary>
public partial class UserInputWindow
{
public UserInputWindow()
{
InitializeComponent();
}
public string? Result { get; set; }
public static string? Show(Window? owner, string? header, string? title = null, string? defaultValue = null)
{
var window = new UserInputWindow
{
Owner = owner,
Title = title ?? "Intromat",
Header = { Text = header ?? "Enter value:" }
};
if (defaultValue != null)
window.Input.Text = window.Result = defaultValue;
window.Input.SelectAll();
window.Input.Focus();
return window.ShowDialog() == true ? window.Result : null;
}
private void Input_OnTextChanged(object sender, TextChangedEventArgs e)
{
Result = Input.Text;
}
private void ButtonOK_OnClick(object sender, RoutedEventArgs e)
{
DialogResult = true;
Close();
}
private void ButtonCancel_OnClick(object sender, RoutedEventArgs e)
{
DialogResult = false;
Close();
}
private void UserInputWindow_OnClosing(object sender, CancelEventArgs e)
{
if (DialogResult != true)
Result = null;
}
}
}