Skip to content

Commit df0d95f

Browse files
committed
Added comments.
1 parent 98eca30 commit df0d95f

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

SuperGrate/Controls/ChangeSetting.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ namespace SuperGrate.Controls
77
public partial class ChangeSetting : Form
88
{
99
private string Setting = "";
10+
/// <summary>
11+
/// Entry point for the ChangeSetting class. This method will display a form with the selected setting and allow the user to change it's value.
12+
/// </summary>
13+
/// <param name="SettingToChange">The key name of the Config.Settings[] dictionary to change.</param>
1014
public ChangeSetting(string SettingToChange)
1115
{
1216
InitializeComponent();
@@ -16,6 +20,9 @@ public ChangeSetting(string SettingToChange)
1620
btnRestoreDefault.SetSystemIcon(Properties.Resources.reload);
1721
Setting = SettingToChange;
1822
}
23+
/// <summary>
24+
/// This event will fire when the changeSetting form has loaded. The method will fill in the selected information into the form's controls.
25+
/// </summary>
1926
private void ChangeSetting_Load(object sender, EventArgs e)
2027
{
2128
Text += Setting;
@@ -31,11 +38,17 @@ private void ChangeSetting_Load(object sender, EventArgs e)
3138
}
3239
tbComment.Text = lastComment + "\r\n\r\n" + "Default Value: " + Config.DefaultSettings[Setting];
3340
}
41+
/// <summary>
42+
/// This event will fire when the btnSave button is clicked. The method will apply the setting to the session.
43+
/// </summary>
3444
private void BtnSave_Click(object sender, EventArgs e)
3545
{
3646
Config.Settings[Setting] = tbValue.Text;
3747
DialogResult = DialogResult.OK;
3848
}
49+
/// <summary>
50+
/// This event will fire when the tbValue text box gets an input. The method will simulate a click for the btnSave button if the enter key is pressed.
51+
/// </summary>
3952
private void TbValue_KeyPress(object sender, KeyPressEventArgs e)
4053
{
4154
if (e.KeyChar == '\r')
@@ -44,6 +57,9 @@ private void TbValue_KeyPress(object sender, KeyPressEventArgs e)
4457
btnSave.PerformClick();
4558
}
4659
}
60+
/// <summary>
61+
/// This event will fire when the btnRestoreDefault button is clicked. The method will restore the default value for the setting.
62+
/// </summary>
4763
private void btnRestoreDefault_Click(object sender, EventArgs e)
4864
{
4965
tbValue.Text = Config.DefaultSettings[Setting];

SuperGrate/Controls/ConfirmDialog.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ namespace SuperGrate.Controls
55
{
66
public partial class ConfirmDialog : Form
77
{
8+
/// <summary>
9+
/// Entry point for the ConfirmDialog class. This method displays a Dialog box with a custom title, message, and icon.
10+
/// </summary>
11+
/// <param name="DialogTitle">Title text.</param>
12+
/// <param name="DialogDescription">Main message text.</param>
13+
/// <param name="DialogIcon">Icon to show in the dialog box.</param>
814
public ConfirmDialog(string DialogTitle, string DialogDescription = null, Icon DialogIcon = null)
915
{
1016
InitializeComponent();

SuperGrate/Controls/Settings.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ namespace SuperGrate.Controls
77
{
88
public partial class Settings : Form
99
{
10+
/// <summary>
11+
/// This method is the entrypoint for the settings class.
12+
/// </summary>
1013
public Settings()
1114
{
1215
InitializeComponent();
@@ -15,11 +18,17 @@ public Settings()
1518
btnRevert.SetSystemIcon(Properties.Resources.reload);
1619
btnApply.SetSystemIcon(Properties.Resources.x);
1720
}
21+
/// <summary>
22+
/// This event fires when the settings form loads. The method calls RefreshSettings.
23+
/// </summary>
1824
private void Settings_Load(object sender, EventArgs e)
1925
{
2026
RefreshSettings();
2127
btnSave.Enabled = Config.CanSaveConfig();
2228
}
29+
/// <summary>
30+
/// This method loads the Config.Settings dictionary into the settingsList.
31+
/// </summary>
2332
private void RefreshSettings()
2433
{
2534
settingsList.Items.Clear();
@@ -41,6 +50,9 @@ private void RefreshSettings()
4150
}
4251
settingsList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
4352
}
53+
/// <summary>
54+
/// This event fires when the btnRevert button is clicked. The method re-loads the configuration on disk back into the settingsList control.
55+
/// </summary>
4456
private async void btnRevert_Click(object sender, EventArgs e)
4557
{
4658
btnRevert.Enabled = false;
@@ -54,6 +66,9 @@ private async void btnRevert_Click(object sender, EventArgs e)
5466
btnRevert.Text = text;
5567
btnRevert.Enabled = true;
5668
}
69+
/// <summary>
70+
/// This event fires when the settingsList list is double clicked. The method opens the selected setting for editing.
71+
/// </summary>
5772
private void SettingsList_DoubleClick(object sender, EventArgs e)
5873
{
5974
if (settingsList.SelectedItems.Count != 0)
@@ -69,6 +84,9 @@ private void SettingsList_DoubleClick(object sender, EventArgs e)
6984
btnApply.Focus();
7085
}
7186
}
87+
/// <summary>
88+
/// This event fires when the btnSave button is clicked. The method will attempt to save the configuration to disk.
89+
/// </summary>
7290
private async void BtnSave_Click(object sender, EventArgs e)
7391
{
7492
Config.SaveConfig();

SuperGrate/Controls/UserProperties.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ namespace SuperGrate.Controls
66
{
77
public partial class UserProperties : Form
88
{
9+
/// <summary>
10+
/// The entry point for the UserProperties form.
11+
/// </summary>
12+
/// <param name="Template">Template user rows to generate the "Properties" column.</param>
13+
/// <param name="Row">The rows with data to fill in the "Values" column.</param>
914
public UserProperties(UserRow Template, UserRow Row)
1015
{
1116
InitializeComponent();

0 commit comments

Comments
 (0)