Skip to content

Commit

Permalink
Refactors to follow coding convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-DeForrest-Reynolds committed Dec 4, 2023
1 parent 6683a27 commit 1aaec9a
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 58 deletions.
3 changes: 2 additions & 1 deletion Forms/ApplicationHelpForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace Recipsio
Expand Down
3 changes: 2 additions & 1 deletion Forms/ApplicationImagesForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace Recipsio
Expand Down
6 changes: 3 additions & 3 deletions Forms/ApplicationIngredientsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Forms/ApplicationIngredientsForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Windows.Forms;

namespace Recipsio
Expand All @@ -20,15 +21,15 @@ public ApplicationIngredientsForm(MainForm MF, Toolbox TB)
}

}
private void Form_KeyDown(object Sender, KeyEventArgs KeyEvent)
private void Form_Key_Down(object Sender, KeyEventArgs KeyEvent)
{
if (KeyEvent.KeyCode == Keys.Escape)
{
Close();
}
}

private void AddIngredients_Click(object sender, System.EventArgs e)
private void Add_Ingredients_Click(object Sender, EventArgs E)
{
if (IngredientInput.Text != "")
{
Expand All @@ -47,7 +48,7 @@ private void AddIngredients_Click(object sender, System.EventArgs e)
}
}

private void RemoveIngredient_Click(object sender, System.EventArgs e)
private void Remove_Ingredient_Click(object Sender, EventArgs E)
{
if (IngredientsList.SelectedItem != null)
{
Expand Down
2 changes: 1 addition & 1 deletion Forms/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 20 additions & 21 deletions Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

namespace Recipsio
Expand All @@ -22,13 +21,13 @@ public MainForm()
KeyPreview = true;
}

private void Create_New__Recipe_Click(object Sender, EventArgs Eventvent)
private void Create_New_Recipe_Click(object Sender, EventArgs E)
{
Manager.Clear_Content_Boxes();
CurrentRecipe = "";
RecipeList.SelectedItem = null;
}
private void Save_Recipe_Click(object Sender, EventArgs Eventvent)
private void Save_Recipe_Click(object Sender, EventArgs E)
{
if (Manager.Is_Valid_Recipe())
{
Expand All @@ -38,7 +37,7 @@ private void Save_Recipe_Click(object Sender, EventArgs Eventvent)
}
}
}
private void Delete_Recipe_Click(object Sender, EventArgs Event)
private void Delete_Recipe_Click(object Sender, EventArgs E)
{
if (CurrentRecipe == null) { return; }
CurrentRecipe = RecipeList.SelectedItem.ToString()!;
Expand All @@ -47,11 +46,11 @@ private void Delete_Recipe_Click(object Sender, EventArgs Event)
RecipeList.Items.Remove(CurrentRecipe);
RecipeList.SelectedItem = null;
}
private void Time_Mouse_Click(object Sender, MouseEventArgs MouseEvent)
private void Time_Mouse_Click(object Sender, MouseEventArgs ME)
{
Label Label = (Label)Sender;

if (MouseEvent.Button == MouseButtons.Left)
if (ME.Button == MouseButtons.Left)
{
GroupBox LabelGroupBox = (GroupBox)Label.Parent;
RichTextBox Input = new();
Expand All @@ -75,7 +74,7 @@ private void Time_Mouse_Click(object Sender, MouseEventArgs MouseEvent)
Input.BringToFront();
}
}
private void Control_Mouse_Click(object Sender, MouseEventArgs MouseEvent)
private void Control_Mouse_Click(object Sender, MouseEventArgs ME)
{
if (ActiveControl is RichTextBox)
{
Expand All @@ -84,7 +83,7 @@ private void Control_Mouse_Click(object Sender, MouseEventArgs MouseEvent)
RecipeList.Focus();
}
}
private void RecipeList_Selected_Value_Changed(object Sender, EventArgs Eventvent)
private void RecipeList_Selected_Value_Changed(object Sender, EventArgs E)
{
if (RecipeList.SelectedItem == null) return;

Expand All @@ -94,29 +93,29 @@ private void RecipeList_Selected_Value_Changed(object Sender, EventArgs Eventven

Manager.Load_Recipe(CurrentRecipe);
}
private void RichTextBox_Key_Down(object Sender, KeyEventArgs KeyEvent)
private void RichTextBox_Key_Down(object Sender, KeyEventArgs KE)
{
RichTextBox RichTextBox = (RichTextBox)Sender;

if (KeyEvent.Control && KeyEvent.KeyCode == Keys.B)
if (KE.Control && KE.KeyCode == Keys.B)
{
RichTextBox.SelectionBullet = true;
}
}
private void Recipsio_Key_Down(object Sender, KeyEventArgs KeyEvent)
private void Recipsio_Key_Down(object Sender, KeyEventArgs KE)
{
if (KeyEvent.KeyCode == Keys.Escape)
if (KE.KeyCode == Keys.Escape)
{
Close();
}
}
private void Input_Time_Key_Down(object? Sender, KeyEventArgs KeyEvent)
private void Input_Time_Key_Down(object? Sender, KeyEventArgs KE)

Check warning on line 112 in Forms/MainForm.cs

View workflow job for this annotation

GitHub Actions / Build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
{
RichTextBox Input;
Label InputTimeLabel;
if (KeyEvent.KeyCode == Keys.Enter)
if (KE.KeyCode == Keys.Enter)
{
KeyEvent.SuppressKeyPress = true;
KE.SuppressKeyPress = true;
Input = (RichTextBox)Sender!;
InputTimeLabel = (Label)Controls.Find(Input.Tag.ToString(), true)[0];
InputTimeLabel.Text = $"{Input.Text} {InputTimeLabel.Tag}";
Expand All @@ -125,13 +124,13 @@ private void Input_Time_Key_Down(object? Sender, KeyEventArgs KeyEvent)

}
}
private void Time_Leave(object Sender, EventArgs Event)
private void Time_Leave(object Sender, EventArgs E)
{
RichTextBox Control = (RichTextBox)Sender;
Controls.Remove(Control);
}

private void Options_Click(object Sender, EventArgs Event)
private void Options_Click(object Sender, EventArgs E)
{
Dictionary<string, Type> FormMap = new()
{
Expand Down Expand Up @@ -167,24 +166,24 @@ private void Search_Text_Changed(object Sender, EventArgs E)
{

}
private void Add_Recipe_Ingredient_Click(object Sender, EventArgs Event)
private void Add_Recipe_Ingredient_Click(object Sender, EventArgs E)
{
RecipeIngredientForm AIF = new(this, Manager);
AIF.ShowDialog(this);
}
private void Remove_Ingredient_Click(object Sender, EventArgs Event)
private void Remove_Ingredient_Click(object Sender, EventArgs E)
{
if (RecipeIngredients.SelectedItem != null)
{
RecipeIngredients.Items.Remove(RecipeIngredients.SelectedItem);
}
}
private void Add_Recipe_Description_Click(object sender, EventArgs e)
private void Add_Recipe_Description_Click(object Sender, EventArgs e)
{
RecipeDirectionForm RDF = new(this, Manager);
RDF.ShowDialog(this);
}
private void Remove_Recipe_Description_Click(object sender, EventArgs e)
private void Remove_Recipe_Description_Click(object Sender, EventArgs e)
{
if (RecipeDirections.SelectedItem != null)
{
Expand Down
9 changes: 5 additions & 4 deletions Forms/RecipeDirectionForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace Recipsio
Expand All @@ -14,15 +15,15 @@ public RecipeDirectionForm(MainForm MF, Toolbox TB)
InitializeComponent();
KeyPreview = true;
}
private void Form_KeyDown(object Sender, KeyEventArgs KeyEvent)
private void Form_KeyDown(object Sender, KeyEventArgs KE)
{
if (KeyEvent.KeyCode == Keys.Escape)
if (KE.KeyCode == Keys.Escape)
{
Close();
}
}

private void Submit_Recipe_Direction_Click(object sender, System.EventArgs e)
private void Submit_Recipe_Direction_Click(object Sender, EventArgs E)
{
MF.RecipeDirections.Items.Add(RecipeDirection.Text);
Close();
Expand Down
9 changes: 5 additions & 4 deletions Forms/RecipeIngredientForm.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
Expand All @@ -25,14 +26,14 @@ public RecipeIngredientForm(MainForm MF, Toolbox TB)
IngredientChoice.Items.Add(Ingredient.Name);
}
}
private void Form_KeyDown(object Sender, KeyEventArgs KeyEvent)
private void Form_KeyDown(object Sender, KeyEventArgs KE)
{
if (KeyEvent.KeyCode == Keys.Escape)
if (KE.KeyCode == Keys.Escape)
{
Close();
}
}
private void Submit_Recipe_Ingredient_Click(object sender, System.EventArgs e)
private void Submit_Recipe_Ingredient_Click(object Sender, EventArgs E)
{
string ErrorMessage = TB.Is_Valid_Ingredient(this);
if (ErrorMessage == "")
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Recipsio

A recipe manager for home, and professional chefs.


# DeForrest Studios Coding Convention
https://docs.google.com/document/d/e/2PACX-1vSKgdG7fbkTh2J2U5_DgGseCkJMDZKENIAVxUcPHpQvNhv5lVTjeaAck2yU2UCh5taCX9uRu6sdsMc3/pub
26 changes: 13 additions & 13 deletions RecipsioInstaller/RecipsioInstaller.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
{
"Entry"
{
"MsmKey" = "8:_73FE0BE4420E4FC3A8C7082ACBD687BA"
"MsmKey" = "8:_030DF8268EC94FAA840C800CDF5C0E29"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_D148949E4E074307A96104CEB8CD775E"
"MsmKey" = "8:_2AE876015B8B4B8FA37C794B67726D6C"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
Expand Down Expand Up @@ -122,10 +122,10 @@
}
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D148949E4E074307A96104CEB8CD775E"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2AE876015B8B4B8FA37C794B67726D6C"
{
"SourcePath" = "8:..\\recipe.ico"
"TargetName" = "8:recipe.ico"
"SourcePath" = "8:..\\recipsio.ico"
"TargetName" = "8:recipsio.ico"
"Tag" = "8:"
"Folder" = "8:_684C4EB42E8A4D038E4BA6F8AA772F76"
"Condition" = "8:"
Expand Down Expand Up @@ -199,7 +199,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Recipsio"
"ProductCode" = "8:{F246B1AE-5FDC-4189-A1B8-FC7BD81F0832}"
"PackageCode" = "8:{670D96FE-F3DA-43CF-B719-B76289FAC82B}"
"PackageCode" = "8:{EDB3D7A8-11AB-4CF5-B390-114FF0762DC0}"
"UpgradeCode" = "8:{F6997F96-55F9-4080-B42D-002B0119989F}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
Expand Down Expand Up @@ -319,32 +319,32 @@
}
"Shortcut"
{
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_59A9B6D71E744066AC18294B72281C07"
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_2486E3F27D5A4EF29BA276A72792B41C"
{
"Name" = "8:Recipsio"
"Arguments" = "8:"
"Description" = "8:"
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_73FE0BE4420E4FC3A8C7082ACBD687BA"
"Target" = "8:_030DF8268EC94FAA840C800CDF5C0E29"
"Folder" = "8:_5E38DF2CC4E44072A919CF1DFEB846D0"
"WorkingFolder" = "8:_684C4EB42E8A4D038E4BA6F8AA772F76"
"Icon" = "8:_D148949E4E074307A96104CEB8CD775E"
"Icon" = "8:_2AE876015B8B4B8FA37C794B67726D6C"
"Feature" = "8:"
}
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_A1999CDE6D504BA78C25A7100BCA0788"
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_5D58A1C652FD433FA8A3C4F4872157F8"
{
"Name" = "8:Recipsio"
"Arguments" = "8:"
"Description" = "8:"
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_73FE0BE4420E4FC3A8C7082ACBD687BA"
"Target" = "8:_030DF8268EC94FAA840C800CDF5C0E29"
"Folder" = "8:_303F56EE4D2B45FD8ABB2E8EDCD2F1D3"
"WorkingFolder" = "8:_684C4EB42E8A4D038E4BA6F8AA772F76"
"Icon" = "8:_D148949E4E074307A96104CEB8CD775E"
"Icon" = "8:_2AE876015B8B4B8FA37C794B67726D6C"
"Feature" = "8:"
}
}
Expand Down Expand Up @@ -746,7 +746,7 @@
}
"ProjectOutput"
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_73FE0BE4420E4FC3A8C7082ACBD687BA"
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_030DF8268EC94FAA840C800CDF5C0E29"
{
"SourcePath" = "8:..\\obj\\Release\\net6.0-windows7.0\\apphost.exe"
"TargetName" = "8:"
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/Clearing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace Recipsio
{
public partial class Toolbox
{
public void Clear_Times(GroupBox GroupBox)
public void Clear_Times(GroupBox GB)
{
foreach (Control Control in GroupBox.Controls)
foreach (Control Control in GB.Controls)
{
Label TimeLabel = (Label)Control;
Control.Text = $"0 {TimeLabel.Tag}";
Expand Down
Loading

0 comments on commit 1aaec9a

Please sign in to comment.