Changeset 14 for Common/Prompt.cs


Ignore:
Timestamp:
Aug 2, 2022, 11:46:25 AM (22 months ago)
Author:
chronos
Message:
  • Modified: Various improvements.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/Prompt.cs

    r13 r14  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    52using System.IO;
    6 using System.Threading.Tasks;
    73using System.Drawing;
    84using System.Windows.Forms;
     
    2521            TextBox textBox = new TextBox() { Left = 50, Top = 44, Width = 400, Text = initialValue };
    2622            textBox.SelectAll();
    27             Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
     23            Button confirmation = new Button() { Text = @"Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
    2824            confirmation.Click += (sender, e) => { prompt.Close(); };
    2925            prompt.Controls.Add(textBox);
     
    3127            prompt.Controls.Add(textLabel);
    3228            prompt.AcceptButton = confirmation;
    33             prompt.Load += delegate (object sender3, EventArgs e3)
     29            prompt.Load += delegate
    3430            {
    3531                Theme.UseTheme(prompt);
     
    7167            };
    7268            numericUpDown.Select(0, numericUpDown.Text.Length);
    73             Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
     69            Button confirmation = new Button() { Text = @"Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
    7470            confirmation.Click += (sender, e) => { prompt.Close(); };
    7571            prompt.Controls.Add(numericUpDown);
     
    7773            prompt.Controls.Add(textLabel);
    7874            prompt.AcceptButton = confirmation;
    79             prompt.Load += delegate (object sender3, EventArgs e3)
     75            prompt.Load += delegate
    8076            {
    8177                Theme.UseTheme(prompt);
     
    117113                comboBox.SelectedIndex = 0;
    118114            }
    119             Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
     115            Button confirmation = new Button() { Text = @"Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
    120116            confirmation.Click += (sender, e) => { prompt.Close(); };
    121117            prompt.Controls.Add(comboBox);
     
    123119            prompt.Controls.Add(textLabel);
    124120            prompt.AcceptButton = confirmation;
    125             prompt.Load += delegate (object sender3, EventArgs e3)
     121            prompt.Load += delegate
    126122            {
    127123                Theme.UseTheme(prompt);
     
    155151            Button confirmation = new Button()
    156152            {
    157                 Text = "Ok",
     153                Text = @"Ok",
    158154                Left = 350,
    159155                Width = 100,
     
    193189            prompt.Controls.Add(textLabel);
    194190            prompt.AcceptButton = confirmation;
    195             prompt.Load += delegate (object sender3, EventArgs e3)
     191            prompt.Load += delegate
    196192            {
    197193                Theme.UseTheme(prompt);
     
    224220            Label textLabel = new Label() { Left = 50, Top = 20, AutoSize = true, Text = text };
    225221            RichTextBox textBox = new RichTextBox() { Left = 50, Top = 44, Width = 400, Height = dataSize, Text = initialValue };
     222            textBox.TextChanged += delegate
     223            {
     224                Theme.UseTheme(prompt);
     225            };
    226226            textBox.SelectAll();
    227             Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = dataSize + 70, DialogResult = DialogResult.OK };
     227            Button confirmation = new Button() { Text = @"Ok", Left = 350, Width = 100, Top = dataSize + 70, DialogResult = DialogResult.OK };
    228228            confirmation.Click += (sender, e) => { prompt.Close(); };
    229229            prompt.Controls.Add(textBox);
     
    231231            prompt.Controls.Add(textLabel);
    232232            prompt.AcceptButton = confirmation;
    233             prompt.Load += delegate (object sender3, EventArgs e3)
     233            prompt.Load += delegate
    234234            {
    235235                Theme.UseTheme(prompt);
     
    260260        {
    261261            result = fileName;
    262             OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = fileType + " (." + fileExtension + ")|*." +
    263                 fileExtension + "|Any file|*.*", DefaultExt = fileExtension };
     262            OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = fileType + @"|*." +
     263                fileExtension + @"|Any file|*.*", DefaultExt = fileExtension };
    264264            if (!string.IsNullOrEmpty(fileName))
    265265            {
     
    282282        {
    283283            result = fileName;
    284             SaveFileDialog saveFileDialog = new SaveFileDialog()
    285             {
    286                 Filter = fileType + "|*." +
    287                 fileExtension + "|Any file|*.*",
     284            SaveFileDialog saveFileDialog = new SaveFileDialog
     285            {
     286                Filter = fileType + @"|*." +
     287                fileExtension + @"|Any file|*.*",
    288288                DefaultExt = fileExtension
    289289            };
Note: See TracChangeset for help on using the changeset viewer.