Skip to content

Commit

Permalink
Add UI child forms documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
NiX3r committed Jan 18, 2022
1 parent 43f0732 commit cb92185
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 1 deletion.
Binary file modified .vs/CoronaTracker/v17/.suo
Binary file not shown.
42 changes: 41 additions & 1 deletion CoronaTracker/SubForms/CountriesSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@

namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Countries Sub Form
///
/// GUI child of UI
/// Shows UI for get actual data from targeting country
///
/// </summary>

public partial class CountriesSubForm : Form
{

Expand All @@ -35,6 +45,9 @@ public CountriesSubForm()
LogClass.Log($"Sub sub form successfully initialized");
}

/// <summary>
/// Function to load default countries buttons
/// </summary>
private void LoadCountriesDefault()
{
foreach(RegionInfo info in CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(x => new RegionInfo(x.LCID)))
Expand Down Expand Up @@ -95,6 +108,12 @@ private void textBox1_Enter(object sender, EventArgs e)
LogClass.Log($"textBox1 enter event handler end");
}

/// <summary>
/// Function to return Button with it defaults
/// </summary>
/// <returns>
/// Default Button
/// </returns>
private Button CopyDefault()
{
Button button = new Button();
Expand All @@ -110,6 +129,10 @@ private Button CopyDefault()
return button;
}

/// <summary>
/// Function to refresh list of countries by specific parameters
/// </summary>
/// <param name="regex"> variable for parametres </param>
public void LoadList(string regex = "")
{
LogClass.Log("Loading countries list" + (regex.Equals("") ? "" : " with parameters '" + regex + "'"));
Expand All @@ -129,11 +152,23 @@ public void LoadList(string regex = "")
LogClass.Log("Successfully loaded");
}

/// <summary>
/// Function to handle form load event
/// Load list with no parameters
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void CountriesSubForm_Load(object sender, EventArgs e)
{
LoadList();
}

/// <summary>
/// Function to handle country click event
/// Load country data in UI
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void onClick(object sender, EventArgs e)
{
if (!ProgramVariables.CovidCache.ContainsKey(((Button)sender).Text))
Expand All @@ -156,7 +191,12 @@ private void onClick(object sender, EventArgs e)
}
}


/// <summary>
/// Function to handle parameters text box text change event
/// Refresh countries list with specific parameters
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (!textBox1.Text.Equals(""))
Expand Down
10 changes: 10 additions & 0 deletions CoronaTracker/SubForms/DashboardSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@

namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Dashboard Sub Form
///
/// GUI child of UI
/// Shows UI with application important data
///
/// </summary>

public partial class DashboardSubForm : Form
{

Expand Down
19 changes: 19 additions & 0 deletions CoronaTracker/SubForms/HomeSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Home Sub Form
///
/// GUI child of UI
/// Shows UI for basic application data
///
/// </summary>

public partial class HomeSubForm : Form
{

Expand All @@ -31,6 +41,9 @@ public HomeSubForm()

public delegate void timerDelDelegate();
public timerDelDelegate timerDel;
/// <summary>
/// Delegate function to load current time into UI
/// </summary>
void timerDelMethod() { label13.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")}\n{DateTime.Now.ToString("HH:mm:ss")}";}

/// <summary>
Expand Down Expand Up @@ -135,6 +148,12 @@ private void label11_Click(object sender, EventArgs e)
System.Diagnostics.Process.Start("https://www.mockaroo.com");
}

/// <summary>
/// Function to handle form closing event
/// Stop time timer
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void HomeSubForm_FormClosing(object sender, FormClosingEventArgs e)
{
timer.ChangeStatus(false);
Expand Down
15 changes: 15 additions & 0 deletions CoronaTracker/SubForms/PatientSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Patient Sub Form
///
/// GUI child of UI
/// Shows UI for manipulate with patient's data
///
/// </summary>

public partial class PatientSubForm : Form
{

Expand Down Expand Up @@ -101,6 +110,12 @@ private void button1_Click(object sender, EventArgs e)
LogClass.Log($"button1 click event handler end");
}

/// <summary>
/// Function to handle form load event
/// Open default child form - List Sub Sub Form
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void PatientSubForm_Load(object sender, EventArgs e)
{
OpenChildForm(new ListSubSubForm(), button1);
Expand Down
17 changes: 17 additions & 0 deletions CoronaTracker/SubForms/SettingsSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@

namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Settings Sub Form
///
/// GUI child of UI
/// Shows UI for user's settings or to edit other user's poses
///
/// </summary>

public partial class SettingsSubForm : Form
{

Expand Down Expand Up @@ -197,6 +207,13 @@ private void button5_Click(object sender, EventArgs e)
LogClass.Log($"button5 click event handler end");
}

/// <summary>
/// Function to handle form load event
/// Shows logged in user's data
/// Enable / Disable editing others users poses by logged in
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void SettingsSubForm_Load(object sender, EventArgs e)
{
EmployeeInstance employee = DatabaseMethods.GetEmployeeByID(ProgramVariables.ID);
Expand Down
16 changes: 16 additions & 0 deletions CoronaTracker/SubForms/VaccineTypeSubForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@

namespace CoronaTracker.SubForms
{

/// <summary>
///
/// Vaccine Type Sub Form
///
/// GUI child of UI
/// Shows UI for manipulate with vaccine types
///
/// </summary>

public partial class VaccineTypeSubForm : Form
{

Expand Down Expand Up @@ -244,6 +254,12 @@ private void textBox1_TextChanged(object sender, EventArgs e)
LogClass.Log($"textBox1 text changed event handler start");
}

/// <summary>
/// Function to handle form load event
/// Load vaccines buttons
/// </summary>
/// <param name="sender"> variable for sender </param>
/// <param name="e"> variable for event arguments </param>
private void VaccineTypeSubForm_Load(object sender, EventArgs e)
{
vaccineTypes = DatabaseMethods.GetVaccineTypes();
Expand Down

0 comments on commit cb92185

Please sign in to comment.