diff --git a/Advanced Software Engineering/Advanced Software Engineering/Windows/ErrorWindow.cs b/Advanced Software Engineering/Advanced Software Engineering/Windows/ErrorWindow.cs index 9e054bf..e3d6dfc 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Windows/ErrorWindow.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Windows/ErrorWindow.cs @@ -9,19 +9,36 @@ using System.Threading.Tasks; using System.Windows.Forms; namespace Advanced_Software_Engineering { + /// + /// The error window that can show errors, warnings and messages. + /// public partial class ErrorWindow : Form { string desc; - + /// + /// The error message type. + /// public const int ERROR_MESSAGE = 0; + /// + /// The warning message type + /// public const int WARNING_MESSAGE = 1; + /// + /// The info message type + /// public const int INFO_MESSAGE = 2; + /// + /// The image directory which links the message types to the image to display. + /// protected Dictionary IMAGEDIR = new Dictionary { { ERROR_MESSAGE, Properties.Resources.error }, { WARNING_MESSAGE, Properties.Resources.warning }, { INFO_MESSAGE, Properties.Resources.info3 } }; + /// + /// The default error window constructor. Creates an error window with the title "Error", short description "An error has occured", a long description of "None" and message type of ERROR. + /// public ErrorWindow() { InitializeComponent(); this.Text = "Error"; @@ -33,6 +50,14 @@ namespace Advanced_Software_Engineering { Focus(); } + /// + /// The error window constructor. + /// It is responsible for creating an error form which shows the user information depending on the parameters. + /// + /// Title of the window + /// A brief description of the message + /// A detailed description of the message + /// The type of message (can either be: ERROR_MESSAGE, WARNING_MESSAGE or INFO_MESSAGE public ErrorWindow(string title, string brief, string desc, int type) { InitializeComponent(); this.Text = title; @@ -45,7 +70,11 @@ namespace Advanced_Software_Engineering { } - protected void SetPicture(int type) { + /// + /// Sets the picture of the window. + /// + /// The type of message (can either be: ERROR_MESSAGE, WARNING_MESSAGE or INFO_MESSAGE + public void SetPicture(int type) { pictureBox1.Image = IMAGEDIR[type]; pictureBox1.Refresh(); @@ -64,10 +93,20 @@ namespace Advanced_Software_Engineering { } } + /// + /// Closes the from. + /// + /// + /// private void button1_Click(object sender, EventArgs e) { Close(); } + /// + /// Show description window. + /// + /// + /// private void button2_Click(object sender, EventArgs e) { new DetailsWindow(desc).Show(); }