-
Notifications
You must be signed in to change notification settings - Fork 2
/
OutlineParameters.cs
51 lines (47 loc) · 1.41 KB
/
OutlineParameters.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
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GCEd
{
public partial class OutlineParameters : Form
{
public float Thickness { get; set; }
public bool LeftFirst { get; set; }
public bool SkipRight { get; set; }
public bool SkipLeft { get; set; }
public bool BothForward { get; set; }
public OutlineParameters()
{
InitializeComponent();
textBoxThickness.Text = "1.0";
comboBoxOrder.SelectedIndex = 0;
Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
}
protected override void OnClosing(CancelEventArgs e)
{
if (DialogResult == DialogResult.OK)
{
if (!Single.TryParse(textBoxThickness.Text, NumberStyles.Number, CultureInfo.InvariantCulture, out var thickess))
{
e.Cancel = true;
DialogResult = DialogResult.None;
return;
}
Thickness = thickess;
LeftFirst = comboBoxOrder.SelectedIndex == 3 || comboBoxOrder.SelectedIndex == 4 || comboBoxOrder.SelectedIndex == 5;
SkipRight = comboBoxOrder.SelectedIndex == 5;
SkipLeft = comboBoxOrder.SelectedIndex == 2;
BothForward = comboBoxOrder.SelectedIndex == 1 || comboBoxOrder.SelectedIndex == 4;
}
base.OnClosing(e);
}
}
}