diff --git a/Advanced Software Engineering/Advanced Software Engineering/SettingsAndHelperFunctions.cs b/Advanced Software Engineering/Advanced Software Engineering/SettingsAndHelperFunctions.cs index f5746b2..da254eb 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/SettingsAndHelperFunctions.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/SettingsAndHelperFunctions.cs @@ -3,10 +3,19 @@ using System.Windows.Forms; namespace Advanced_Software_Engineering { + /// + /// This class simply provides settings and some functions that are used across many components. + /// public class SettingsAndHelperFunctions { + /// + /// The variable simply keep track of the windows that are currently shown (excluding ). + /// public static int NumberOfWindows = 0; + /// + /// This helper function is executed when a window is closed. It shows the when the count is 0 + /// public static void WindowClosed() { NumberOfWindows--; @@ -18,6 +27,27 @@ namespace Advanced_Software_Engineering } + /// + /// This function removes spaces from the start and the end of the text. This should be unit tested. + /// + /// Simply any string of any size + /// A string without spaces at the begining or the end + /// + /// For example + /// + /// string a = " a simple sentence surrounded by spaces "; + /// string b = StripSpaces(a); + /// Console.WriteLine(b); // => "a simple sentence surrounded by spaces"; + /// + /// + /// + /// The code won't remove internal double spaces: + /// + /// string a = " a simple sentence surrounded by spaces "; + /// string b = StripSpaces(a); + /// Console.WriteLine(b); // => "a simple sentence surrounded by spaces"; + /// + /// public static string StripSpaces(string text) { int start;