-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mit änderbarem Einstellungen Download Pfad
- Loading branch information
1 parent
51ba282
commit 22cc391
Showing
12 changed files
with
416 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using PSU_Calculator.Komponenten; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using System.Windows.Forms; | ||
|
||
namespace PSU_Calculator | ||
{ | ||
/// <summary> | ||
/// Einfaches Input Feld, mit übernehmen Button und Regex Prüfung. | ||
/// </summary> | ||
public partial class InputFeld : Form | ||
{ | ||
PowerSupply PSU; | ||
private Regex myRegex; | ||
public InputFeld(string inTitle, Regex inRegex) | ||
{ | ||
InitializeComponent(); | ||
Name = inTitle; | ||
myRegex = inRegex; | ||
FormClosing += InputFeld_FormClosing; | ||
} | ||
|
||
void InputFeld_FormClosing(object sender, FormClosingEventArgs e) | ||
{ | ||
if (string.IsNullOrWhiteSpace(tbxInput.Text)) | ||
{ | ||
this.DialogResult = DialogResult.Cancel; | ||
} | ||
if (myRegex !=null) | ||
{ | ||
if (!myRegex.IsMatch(tbxInput.Text)) | ||
{ | ||
this.DialogResult = DialogResult.Cancel; | ||
} | ||
} | ||
} | ||
|
||
public string GetText | ||
{ | ||
get | ||
{ | ||
return tbxInput.Text; | ||
} | ||
set | ||
{ | ||
tbxInput.Text = value; | ||
} | ||
} | ||
|
||
private void Finished(object sender, EventArgs e) | ||
{ | ||
DialogResult = DialogResult.OK; | ||
this.Close(); | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.