-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGenericPrompt.cs
45 lines (41 loc) · 1.1 KB
/
GenericPrompt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace XJoy
{
public partial class GenericPrompt : Form
{
public GenericPrompt()
{
InitializeComponent();
}
/// <summary>
/// Creates a prompt
/// </summary>
/// <param name="Title">Text displayed at the top.</param>
/// <param name="BodyText">Main display text.</param>
/// <param name="OptionA">Option text for option A (left).</param>
/// <param name="OptionB">Option text for option B (right).</param>
/// <returns>True if option A was used.</returns>
public static bool DoPrompt(string Title, string BodyText, string OptionA, string OptionB)
{
GenericPrompt GP = new GenericPrompt();
GP.Text = Title;
GP.labelBody.Text = BodyText;
GP.buttonA.Text = OptionA;
GP.buttonB.Text = OptionB;
DialogResult dr = GP.ShowDialog();
return dr == DialogResult.OK;
}
private void OnButtonClicked(object sender, EventArgs e)
{
this.Close();
}
}
}