-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmdarg.cs
45 lines (38 loc) · 1.11 KB
/
cmdarg.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LightNetMailer
{
internal class cmdarg
{
public string ArgName;
public string ArgValue;
public string ArgHelpMessage;
public Action<string> ArgAction;
public bool IsRequired = false;
public cmdarg(string Argname,string ArgHelpMessage,Action<string> ArgAction) // for list
{
this.ArgName = Argname;
this.ArgHelpMessage = ArgHelpMessage;
this.ArgAction = ArgAction;
}
public cmdarg(string Argname,string ArgHelpMessage,string ArgValue,Action<string> ArgAction) // for enabled
{
this.ArgName = Argname;
this.ArgHelpMessage = ArgHelpMessage;
this.ArgValue = ArgValue;
this.ArgAction = ArgAction;
}
public void InvokeParamAction()
{
this.ArgAction.Invoke(this.ArgValue);
}
public cmdarg SetRequired()
{
IsRequired = true;
return this;
}
}
}