|
1 | | -using System; |
| 1 | +// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See doc/License.md in the project root for license information. |
| 2 | + |
2 | 3 | using System.Collections.Generic; |
3 | 4 | using System.Linq; |
4 | | -using System.Text; |
5 | 5 |
|
6 | 6 | namespace CommandLine.Text |
7 | 7 | { |
8 | 8 | public sealed class Example<T> |
9 | 9 | { |
10 | 10 | private readonly string group; |
11 | 11 | private readonly string helpText; |
12 | | - private readonly IEnumerable<UnParserSettings> settings; |
| 12 | + private readonly IEnumerable<UnParserSettings> formatStyles; |
13 | 13 | private readonly T sample; |
14 | 14 |
|
15 | | - public Example(string group, string helpText, IEnumerable<UnParserSettings> settings, T sample) |
| 15 | + public Example(string group, string helpText, IEnumerable<UnParserSettings> formatStyles, T sample) |
16 | 16 | { |
17 | 17 | this.group = group; |
18 | 18 | this.helpText = helpText; |
19 | | - this.settings = settings; |
| 19 | + this.formatStyles = formatStyles; |
20 | 20 | this.sample = sample; |
21 | 21 | } |
| 22 | + |
| 23 | + public Example(string helpText, IEnumerable<UnParserSettings> formatStyles, T sample) |
| 24 | + : this(string.Empty, helpText, formatStyles, sample) |
| 25 | + { |
| 26 | + } |
| 27 | + |
| 28 | + public Example(string helpText, UnParserSettings formatStyle, T sample) |
| 29 | + : this(string.Empty, helpText, new[] { formatStyle }, sample) |
| 30 | + { |
| 31 | + } |
| 32 | + |
| 33 | + public Example(string helpText, T sample) |
| 34 | + : this(string.Empty, helpText, Enumerable.Empty<UnParserSettings>(), sample) |
| 35 | + { |
| 36 | + } |
| 37 | + |
| 38 | + public string Group |
| 39 | + { |
| 40 | + get { return group } |
| 41 | + } |
| 42 | + |
| 43 | + public string HelpText |
| 44 | + { |
| 45 | + get { return helpText } |
| 46 | + } |
| 47 | + |
| 48 | + public IEnumerable<UnParserSettings> FormatStyles |
| 49 | + { |
| 50 | + get { return this.formatStyles } |
| 51 | + } |
| 52 | + |
| 53 | + public T Sample |
| 54 | + { |
| 55 | + get { return sample } |
| 56 | + } |
22 | 57 | } |
23 | 58 | } |
0 commit comments