diff --git a/Crypto Notepad/WinFormsExtensions.cs b/Crypto Notepad/WinFormsExtensions.cs new file mode 100644 index 0000000..24441c9 --- /dev/null +++ b/Crypto Notepad/WinFormsExtensions.cs @@ -0,0 +1,24 @@ +using System; +using System.Windows.Forms; + +namespace Crypto_Notepad +{ + public static class WinFormsExtensions + { + public static void AppendLine(this TextBox source, string value) + { + if (source.Text.Length == 0) + source.Text = value; + else + source.AppendText("\r\n" + value); + } + + public static void Times(this int count, Action action) + { + for (int i = 0; i < count; i++) + { + action(); + } + } + } +}