-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (41 loc) · 1.57 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*Author: Unknown: Project 3 starter Code
Purpose:set textbox values and validation requirements for user input
Date: August 14, 2020
*/
namespace Project_3_Starter
{
class Program
{
static void Main(string[] args)
{
//1. Create a Form object
Form form = new Form();
//2. Populate the Form's list with 6 hard-coded IFormComponent objects
form.AddComponent(
new MinLengthValidator(
new Textbox("Username"), 6));
form.AddComponent(
new CharacterValidator(
new CharacterValidator(
new Textbox("Email"), "@"),
"."));
form.AddComponent(
new MinLengthValidator(
new Textbox("Real Name"), 2));
IFormComponent password = new CharacterValidator(
new MinLengthValidator(
new Textbox("Password"), 8)
, "!");
form.AddComponent(password);
form.AddComponent
(new ValueMatchValidator(
new Textbox("Confirm Password"), password));
form.AddComponent(new NumberValidator
(new Textbox("Age")));
////3. Create a FormInput object to begin communication with the user
/////this is null because I havent figured out how to make it work
FormInput context = new FormInput(form);
context.Run();
}
}
}