File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+
6+ namespace CommandLine
7+ {
8+ public abstract class BaseAttribute
9+ {
10+ private int min ;
11+ private int max ;
12+ private object @default ;
13+
14+ protected BaseAttribute ( )
15+ {
16+ min = - 1 ;
17+ max = - 1 ;
18+ }
19+
20+ /// <summary>
21+ /// Gets or sets a value indicating whether a command line option is required.
22+ /// </summary>
23+ public bool Required
24+ {
25+ get ;
26+ set ;
27+ }
28+
29+ /// <summary>
30+ /// When applied to <see cref="System.Collections.Generic.IEnumerable{T}"/> properties defines
31+ /// the lower range of items.
32+ /// </summary>
33+ /// <remarks>If not set, no lower range is enforced.</remarks>
34+ public int Min
35+ {
36+ get { return min ; }
37+ set
38+ {
39+ if ( value < 0 )
40+ {
41+ throw new ArgumentNullException ( "value" ) ;
42+ }
43+
44+ min = value ;
45+ }
46+ }
47+
48+ /// <summary>
49+ /// When applied to <see cref="System.Collections.Generic.IEnumerable{T}"/> properties defines
50+ /// the upper range of items.
51+ /// </summary>
52+ /// <remarks>If not set, no upper range is enforced.</remarks>
53+ public int Max
54+ {
55+ get { return max ; }
56+ set
57+ {
58+ if ( value < 0 )
59+ {
60+ throw new ArgumentNullException ( "value" ) ;
61+ }
62+
63+ max = value ;
64+ }
65+ }
66+
67+ /// <summary>
68+ /// Gets or sets mapped property default value.
69+ /// </summary>
70+ public object Default
71+ {
72+ get { return @default ; }
73+ set
74+ {
75+ if ( value == null )
76+ {
77+ throw new ArgumentNullException ( "value" ) ;
78+ }
79+
80+ @default = value ;
81+ }
82+ }
83+ }
84+ }
Original file line number Diff line number Diff line change 5858 <Compile Include =" ..\SharedAssemblyInfo.cs" >
5959 <Link >Properties\SharedAssemblyInfo.cs</Link >
6060 </Compile >
61+ <Compile Include =" BaseAttribute.cs" />
6162 <Compile Include =" Core\ArgumentsExtension.cs" />
6263 <Compile Include =" Core\KeyValuePairHelper.cs" />
6364 <Compile Include =" Core\PreprocessorGuards.cs" />
You can’t perform that action at this time.
0 commit comments