BadScript 2
Loading...
Searching...
No Matches
Options_With_Property_Throwing_Exception.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
8{
10 {
11 private string optValue;
12
13 [Option('e')]
14 public string OptValue
15 {
16 get
17 {
18 return optValue;
19 }
20 set
21 {
22 if (value != "good")
23 throw new ArgumentException("Invalid value, only accept 'good' value");
24
25 optValue = value;
26 }
27 }
28 }
29}