BadScript 2
Loading...
Searching...
No Matches
CommandLine.Text.Example Class Referencesealed

Models a command line usage example. More...

Inheritance diagram for CommandLine.Text.Example:

Public Member Functions

 Example (string helpText, IEnumerable< UnParserSettings > formatStyles, object sample)
 Initializes a new instance of the CommandLine.Text.Example class.
 
 Example (string helpText, UnParserSettings formatStyle, object sample)
 Initializes a new instance of the CommandLine.Text.Example class.
 
 Example (string helpText, object sample)
 Initializes a new instance of the CommandLine.Text.Example class.
 
bool Equals (Example other)
 Returns a value that indicates whether the current instance and a specified CommandLine.Text.Example have the same value.
 
override bool Equals (object obj)
 Determines whether the specified System.Object is equal to the current System.Object.
 
override int GetHashCode ()
 Serves as a hash function for a particular type.
 

Properties

string HelpText [get]
 Example description.
 
IEnumerable< UnParserSettingsFormatStyles [get]
 A sequence of format styles.
 
object Sample [get]
 A sample instance.
 

Detailed Description

Models a command line usage example.

Definition at line 12 of file Example.cs.

Constructor & Destructor Documentation

◆ Example() [1/3]

CommandLine.Text.Example.Example ( string  helpText,
IEnumerable< UnParserSettings formatStyles,
object  sample 
)

Initializes a new instance of the CommandLine.Text.Example class.

Parameters
helpTextExample description.
formatStylesA CommandLine.UnParserSettings instances sequence that defines command line arguments format.
sampleA sample instance.

Definition at line 23 of file Example.cs.

24 {
25 if (string.IsNullOrEmpty(helpText))
26 {
27 throw new ArgumentException("helpText can't be null or empty", "helpText");
28 }
29
30 if (formatStyles == null)
31 {
32 throw new ArgumentNullException("formatStyles");
33 }
34
35 if (sample == null)
36 {
37 throw new ArgumentNullException("sample");
38 }
39
40 HelpText = helpText;
41 FormatStyles = formatStyles;
42 Sample = sample;
43 }
IEnumerable< UnParserSettings > FormatStyles
A sequence of format styles.
Definition Example.cs:76
object Sample
A sample instance.
Definition Example.cs:81
string HelpText
Example description.
Definition Example.cs:71

◆ Example() [2/3]

CommandLine.Text.Example.Example ( string  helpText,
UnParserSettings  formatStyle,
object  sample 
)

Initializes a new instance of the CommandLine.Text.Example class.

Parameters
helpTextExample description.
formatStyleA CommandLine.UnParserSettings instance that defines command line arguments format.
sampleA sample instance.

Definition at line 54 of file Example.cs.

55 : this(helpText,
56 new[] { formatStyle },
57 sample
58 ) { }

◆ Example() [3/3]

CommandLine.Text.Example.Example ( string  helpText,
object  sample 
)

Initializes a new instance of the CommandLine.Text.Example class.

Parameters
helpTextExample description.
sampleA sample instance.

Definition at line 65 of file Example.cs.

66 : this(helpText, Enumerable.Empty<UnParserSettings>(), sample) { }

Member Function Documentation

◆ Equals() [1/2]

bool CommandLine.Text.Example.Equals ( Example  other)

Returns a value that indicates whether the current instance and a specified CommandLine.Text.Example have the same value.

Parameters
otherThe CommandLine.Text.Example instance to compare.
Returns
true

if this instance of CommandLine.Text.Example and other have the same value; otherwise,

false

Definition at line 97 of file Example.cs.

98 {
99 if (other == null)
100 {
101 return false;
102 }
103
104 return HelpText.Equals(other.HelpText) &&
105 FormatStyles.SequenceEqual(other.FormatStyles) &&
106 Sample.Equals(other.Sample);
107 }

◆ Equals() [2/2]

override bool CommandLine.Text.Example.Equals ( object  obj)

Determines whether the specified System.Object is equal to the current System.Object.

Parameters
objThe System.Object to compare with the current System.Object.
Returns
true

if the specified System.Object is equal to the current System.Object; otherwise,

false

Definition at line 121 of file Example.cs.

122 {
123 Example other = obj as Example;
124
125 if (other != null)
126 {
127 return Equals(other);
128 }
129
130 return base.Equals(obj);
131 }
Example(string helpText, IEnumerable< UnParserSettings > formatStyles, object sample)
Initializes a new instance of the CommandLine.Text.Example class.
Definition Example.cs:23
bool Equals(Example other)
Returns a value that indicates whether the current instance and a specified CommandLine....
Definition Example.cs:97

◆ GetHashCode()

override int CommandLine.Text.Example.GetHashCode ( )

Serves as a hash function for a particular type.

A hash code for the current System.Object.

Definition at line 137 of file Example.cs.

138 {
139 return new { HelpText, FormatStyles, Sample }.GetHashCode();
140 }

Property Documentation

◆ FormatStyles

IEnumerable<UnParserSettings> CommandLine.Text.Example.FormatStyles
get

A sequence of format styles.

Definition at line 76 of file Example.cs.

76{ get; }

◆ HelpText

string CommandLine.Text.Example.HelpText
get

Example description.

Definition at line 71 of file Example.cs.

71{ get; }

◆ Sample

object CommandLine.Text.Example.Sample
get

A sample instance.

Definition at line 81 of file Example.cs.

81{ get; }

The documentation for this class was generated from the following file: