mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Added helper class
This commit is contained in:
parent
7c367028ff
commit
598006d735
1 changed files with 24 additions and 0 deletions
24
Crypto Notepad/WinFormsExtensions.cs
Normal file
24
Crypto Notepad/WinFormsExtensions.cs
Normal file
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue