BadScript 2
Loading...
Searching...
No Matches
CommandLine.NameInfo Class Referencesealed

Models name information, used in CommandLine.Error instances. More...

Inheritance diagram for CommandLine.NameInfo:

Public Member Functions

bool Equals (NameInfo other)
 Returns a value that indicates whether the current instance and a specified CommandLine.NameInfo 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.
 

Static Public Attributes

static readonly NameInfo EmptyName = new NameInfo(string.Empty, string.Empty)
 Represents an empty name information. Used when CommandLine.Error are tied to values, rather than options.
 

Package Functions

 NameInfo (string shortName, string longName)
 

Properties

string ShortName [get]
 Gets the short name of the name information.
 
string LongName [get]
 Gets the long name of the name information.
 
string NameText [get]
 Gets a formatted text with unified name information.
 

Detailed Description

Models name information, used in CommandLine.Error instances.

Definition at line 10 of file NameInfo.cs.

Constructor & Destructor Documentation

◆ NameInfo()

CommandLine.NameInfo.NameInfo ( string  shortName,
string  longName 
)
package

Definition at line 18 of file NameInfo.cs.

19 {
20 if (shortName == null)
21 {
22 throw new ArgumentNullException("shortName");
23 }
24
25 if (longName == null)
26 {
27 throw new ArgumentNullException("longName");
28 }
29
30 LongName = longName;
31 ShortName = shortName;
32 }
string LongName
Gets the long name of the name information.
Definition NameInfo.cs:42
string ShortName
Gets the short name of the name information.
Definition NameInfo.cs:37

Member Function Documentation

◆ Equals() [1/2]

bool CommandLine.NameInfo.Equals ( NameInfo  other)

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

Parameters
otherThe CommandLine.NameInfo instance to compare.
Returns
true

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

false

Definition at line 64 of file NameInfo.cs.

65 {
66 if (other == null)
67 {
68 return false;
69 }
70
71 return ShortName.Equals(other.ShortName) && LongName.Equals(other.LongName);
72 }

◆ Equals() [2/2]

override bool CommandLine.NameInfo.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 86 of file NameInfo.cs.

87 {
88 NameInfo other = obj as NameInfo;
89
90 if (other != null)
91 {
92 return Equals(other);
93 }
94
95 return base.Equals(obj);
96 }
NameInfo(string shortName, string longName)
Definition NameInfo.cs:18
bool Equals(NameInfo other)
Returns a value that indicates whether the current instance and a specified CommandLine....
Definition NameInfo.cs:64

◆ GetHashCode()

override int CommandLine.NameInfo.GetHashCode ( )

Serves as a hash function for a particular type.

A hash code for the current System.Object.

Definition at line 102 of file NameInfo.cs.

103 {
104 return new { ShortName, LongName }.GetHashCode();
105 }

Member Data Documentation

◆ EmptyName

readonly NameInfo CommandLine.NameInfo.EmptyName = new NameInfo(string.Empty, string.Empty)
static

Represents an empty name information. Used when CommandLine.Error are tied to values, rather than options.

Definition at line 16 of file NameInfo.cs.

Property Documentation

◆ LongName

string CommandLine.NameInfo.LongName
get

Gets the long name of the name information.

Definition at line 42 of file NameInfo.cs.

42{ get; }

◆ NameText

string CommandLine.NameInfo.NameText
get

Gets a formatted text with unified name information.

Definition at line 47 of file NameInfo.cs.

◆ ShortName

string CommandLine.NameInfo.ShortName
get

Gets the short name of the name information.

Definition at line 37 of file NameInfo.cs.

37{ get; }

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