Provides base properties for creating an attribute, used to define multiple lines of text.
More...
|
| MultilineTextAttribute (string line1) |
| Initializes a new instance of the MultilineTextAttribute class. Used in derived type using one line of text.
|
|
| MultilineTextAttribute (string line1, string line2) |
| Initializes a new instance of the MultilineTextAttribute class. Used in type using two lines of text.
|
|
| MultilineTextAttribute (string line1, string line2, string line3) |
| Initializes a new instance of the MultilineTextAttribute class. Used in type using three lines of text.
|
|
| MultilineTextAttribute (string line1, string line2, string line3, string line4) |
| Initializes a new instance of the MultilineTextAttribute class. Used in type using four lines of text.
|
|
| MultilineTextAttribute (string line1, string line2, string line3, string line4, string line5) |
| Initializes a new instance of the MultilineTextAttribute class. Used in type using five lines of text.
|
|
virtual int | GetLastLineWithText (string[] value) |
| Returns the last line with text. Preserves blank lines if user intended by skipping a line.
|
|
|
virtual string | Value [get] |
| Gets the all non-blank lines as string.
|
|
string | Line1 [get] |
| Gets the first line of text.
|
|
string | Line2 [get] |
| Gets the second line of text.
|
|
string | Line3 [get] |
| Gets third line of text.
|
|
string | Line4 [get] |
| Gets the fourth line of text.
|
|
string | Line5 [get] |
| Gets the fifth line of text.
|
|
Provides base properties for creating an attribute, used to define multiple lines of text.
Definition at line 12 of file MultiLineTextAttribute.cs.
◆ MultilineTextAttribute() [1/5]
CommandLine.Text.MultilineTextAttribute.MultilineTextAttribute |
( |
string |
line1 | ) |
|
|
protected |
Initializes a new instance of the MultilineTextAttribute class. Used in derived type using one line of text.
- Parameters
-
line1 | The first line of text. |
Definition at line 19 of file MultiLineTextAttribute.cs.
20 : this(line1, string.Empty, string.Empty, string.Empty, string.Empty) { }
◆ MultilineTextAttribute() [2/5]
CommandLine.Text.MultilineTextAttribute.MultilineTextAttribute |
( |
string |
line1, |
|
|
string |
line2 |
|
) |
| |
|
protected |
Initializes a new instance of the MultilineTextAttribute class. Used in type using two lines of text.
- Parameters
-
line1 | The first line of text. |
line2 | The second line of text. |
Definition at line 28 of file MultiLineTextAttribute.cs.
29 : this(line1, line2, string.Empty, string.Empty, string.Empty) { }
◆ MultilineTextAttribute() [3/5]
CommandLine.Text.MultilineTextAttribute.MultilineTextAttribute |
( |
string |
line1, |
|
|
string |
line2, |
|
|
string |
line3 |
|
) |
| |
|
protected |
Initializes a new instance of the MultilineTextAttribute class. Used in type using three lines of text.
- Parameters
-
line1 | The first line of text. |
line2 | The second line of text. |
line3 | The third line of text. |
Definition at line 38 of file MultiLineTextAttribute.cs.
39 : this(line1, line2, line3, string.Empty, string.Empty) { }
◆ MultilineTextAttribute() [4/5]
CommandLine.Text.MultilineTextAttribute.MultilineTextAttribute |
( |
string |
line1, |
|
|
string |
line2, |
|
|
string |
line3, |
|
|
string |
line4 |
|
) |
| |
|
protected |
Initializes a new instance of the MultilineTextAttribute class. Used in type using four lines of text.
- Parameters
-
line1 | The first line of text. |
line2 | The second line of text. |
line3 | The third line of text. |
line4 | The fourth line of text. |
Definition at line 49 of file MultiLineTextAttribute.cs.
50 : this(line1, line2, line3, line4, string.Empty) { }
◆ MultilineTextAttribute() [5/5]
CommandLine.Text.MultilineTextAttribute.MultilineTextAttribute |
( |
string |
line1, |
|
|
string |
line2, |
|
|
string |
line3, |
|
|
string |
line4, |
|
|
string |
line5 |
|
) |
| |
|
protected |
Initializes a new instance of the MultilineTextAttribute class. Used in type using five lines of text.
- Parameters
-
line1 | The first line of text. |
line2 | The second line of text. |
line3 | The third line of text. |
line4 | The fourth line of text. |
line5 | The fifth line of text. |
Definition at line 61 of file MultiLineTextAttribute.cs.
62 {
63 if (line1 == null)
64 {
65 throw new ArgumentException("line1");
66 }
67
68 if (line2 == null)
69 {
70 throw new ArgumentException("line2");
71 }
72
73 if (line3 == null)
74 {
75 throw new ArgumentException("line3");
76 }
77
78 if (line4 == null)
79 {
80 throw new ArgumentException("line4");
81 }
82
83 if (line5 == null)
84 {
85 throw new ArgumentException("line5");
86 }
87
93 }
string Line4
Gets the fourth line of text.
string Line2
Gets the second line of text.
string Line1
Gets the first line of text.
string Line5
Gets the fifth line of text.
string Line3
Gets third line of text.
◆ AddToHelpText() [1/2]
HelpText CommandLine.Text.MultilineTextAttribute.AddToHelpText |
( |
HelpText |
helpText, |
|
|
bool |
before |
|
) |
| |
|
package |
Definition at line 148 of file MultiLineTextAttribute.cs.
149 {
150
151
152 return before
155 }
HelpText AddToHelpText(HelpText helpText, Func< string, HelpText > func)
◆ AddToHelpText() [2/2]
Definition at line 140 of file MultiLineTextAttribute.cs.
141 {
143
145 .Aggregate(helpText, (current, line) => func(line));
146 }
virtual int GetLastLineWithText(string[] value)
Returns the last line with text. Preserves blank lines if user intended by skipping a line.
◆ GetLastLineWithText()
virtual int CommandLine.Text.MultilineTextAttribute.GetLastLineWithText |
( |
string[] |
value | ) |
|
|
protectedvirtual |
Returns the last line with text. Preserves blank lines if user intended by skipping a line.
- Returns
- The last index of line of the non-blank line.
- Parameters
-
value | The string array to process. |
Definition at line 164 of file MultiLineTextAttribute.cs.
165 {
166 int index = Array.FindLastIndex(value, str => !string.IsNullOrEmpty(str));
167
168
169 return index + 1;
170 }
◆ Line1
string CommandLine.Text.MultilineTextAttribute.Line1 |
|
get |
◆ Line2
string CommandLine.Text.MultilineTextAttribute.Line2 |
|
get |
◆ Line3
string CommandLine.Text.MultilineTextAttribute.Line3 |
|
get |
◆ Line4
string CommandLine.Text.MultilineTextAttribute.Line4 |
|
get |
◆ Line5
string CommandLine.Text.MultilineTextAttribute.Line5 |
|
get |
◆ Value
virtual string CommandLine.Text.MultilineTextAttribute.Value |
|
get |
Gets the all non-blank lines as string.
A string of all non-blank lines.
Definition at line 99 of file MultiLineTextAttribute.cs.
100 {
101 get
102 {
103 StringBuilder value = new StringBuilder(string.Empty);
105
107 {
108 value.AppendLine(strArray[i]);
109 }
110
111 return value.ToString();
112 }
113 }
The documentation for this class was generated from the following file: