-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathScenarioProperties.cs
More file actions
76 lines (63 loc) · 2.14 KB
/
Copy pathScenarioProperties.cs
File metadata and controls
76 lines (63 loc) · 2.14 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) 2016 SolarLiner - Part of the TLE Orbiter Sceneraio Generator (TLEOSG)
using System;
using System.Windows.Forms;
namespace TLEOrbiter
{
public partial class ScenarioProperties : Form
{
public ScenarioProperties()
{
InitializeComponent();
}
private DateTime dt;
public double MJD { get; set; }
public string ScenarioName { get; set; }
public string Description { get; set; }
private void ScenarioProperties_Load(object sender, EventArgs e)
{
if (MJD == -1d) CB_UseSysTime.Checked = true;
else dt = AOSP.Misc.GetTime(MJD);
TB_ScnName.Text = ScenarioName;
RTB_ScnDesc.Text = Description;
}
private void CB_UseSysTime_CheckedChanged(object sender, EventArgs e)
{
if (CB_UseSysTime.Checked) BT_ChangeDate.Enabled = false;
else BT_ChangeDate.Enabled = true;
MJD = CB_UseSysTime.Checked ? -1 : AOSP.Misc.GetMJD(dt);
}
private void BT_ChangeDate_Click(object sender, EventArgs e)
{
DateChange DC = new DateChange();
DC.PickedTime = dt;
if (DC.ShowDialog() == DialogResult.OK)
{
MJD = DC.PickedMJD;
dt = DC.PickedTime;
}
DialogResult = DialogResult.None;
}
private void TB_ScnName_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(TB_ScnName.Text))
ER_Verifier.SetError(TB_ScnName, "Name cannot be empty.");
else
{
ScenarioName = TB_ScnName.Text;
ER_Verifier.SetError(TB_ScnName, "");
}
}
private void BT_Cancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void BT_OK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void RTB_ScnDesc_TextChanged(object sender, EventArgs e)
{
Description = RTB_ScnDesc.Text;
}
}
}