Skip to content

Commit 2fbc901

Browse files
committed
Adding Example members
1 parent 566a728 commit 2fbc901

1 file changed

Lines changed: 40 additions & 5 deletions

File tree

src/CommandLine/Text/Example.cs

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,58 @@
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+
23
using System.Collections.Generic;
34
using System.Linq;
4-
using System.Text;
55

66
namespace CommandLine.Text
77
{
88
public sealed class Example<T>
99
{
1010
private readonly string group;
1111
private readonly string helpText;
12-
private readonly IEnumerable<UnParserSettings> settings;
12+
private readonly IEnumerable<UnParserSettings> formatStyles;
1313
private readonly T sample;
1414

15-
public Example(string group, string helpText, IEnumerable<UnParserSettings> settings, T sample)
15+
public Example(string group, string helpText, IEnumerable<UnParserSettings> formatStyles, T sample)
1616
{
1717
this.group = group;
1818
this.helpText = helpText;
19-
this.settings = settings;
19+
this.formatStyles = formatStyles;
2020
this.sample = sample;
2121
}
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+
}
2257
}
2358
}

0 commit comments

Comments
 (0)