\n\n";
342 | chapter[1] += Methods.GetNovelBody(doc, details.CurrentFileType);
343 |
344 | if (doc.DocumentNode.SelectSingleNode("//div[@id='novel_honbun']").InnerHtml.Contains("Contains image(s)\n\n===", subLink);
348 | }
349 | }
350 | return chapter;
351 | }
352 |
353 | public static void SaveFile(Syousetsu.Constants details, string[] chapter, int current)
354 | {
355 | string path = CheckDirectory(details, current);
356 |
357 | //replace illigal character(s) with "□"
358 | string regexSearch = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars());
359 | Regex r = new Regex(string.Format("[{0}]", System.Text.RegularExpressions.Regex.Escape(regexSearch)));
360 | chapter[0] = r.Replace(chapter[0], "□");
361 |
362 | //save the chapter
363 | string fileName = details.FilenameFormat.Replace("/", "\\")
364 | .Split('\\').Last();
365 | if (details.CurrentFileType == Constants.FileType.Text)
366 | {
367 | fileName = String.Format(fileName + ".txt",
368 | new object[] { current, chapter[0], details.SeriesCode });
369 | }
370 | else if (details.CurrentFileType == Constants.FileType.HTML)
371 | {
372 | fileName = String.Format(fileName + ".htm",
373 | new object[] { current, chapter[0], details.SeriesCode });
374 |
375 | File.WriteAllText(Path.Combine(path, "ChapterStyle.css"), "@charset \"UTF - 8\";\n/*chapter css here*/");
376 | }
377 |
378 | chapter[0] = String.Empty;
379 | fileName = Path.Combine(path, fileName);
380 | File.WriteAllLines(fileName, chapter, Encoding.Unicode);
381 | }
382 |
383 | public static void GenerateTableOfContents(Syousetsu.Constants details, HtmlDocument doc)
384 | {
385 | //create novel folder if it doesn't exist
386 | CheckDirectory(details);
387 |
388 | HtmlNode tocNode = doc.DocumentNode.SelectSingleNode("//div[@class='index_box']");
389 | HtmlNodeCollection cssNodeList = doc.DocumentNode.SelectNodes("//link[@rel='stylesheet']");
390 |
391 | var cssNode = (from n in cssNodeList
392 | where n.Attributes["href"].Value.Contains("ncout.css") || n.Attributes["href"].Value.Contains("ncout2.css")
393 | select n).ToList();
394 |
395 | //get css link and download
396 | string pattern = "(href=\")(?.+)(?=\" media)";
397 | Regex r = new Regex(pattern);
398 | Match m = r.Match(cssNode[0].OuterHtml);
399 | string cssink = m.Groups["link"].Value;
400 | DownloadCss(details, cssink);
401 |
402 | StringBuilder sb = new StringBuilder();
403 | sb.AppendLine("");
404 | sb.AppendLine("");
405 | sb.AppendLine("\t");
406 | sb.AppendLine("\t");
407 | sb.AppendLine("");
408 |
409 | sb.AppendLine("");
410 |
411 | //edit all href
412 | int i = 1;
413 | HtmlNodeCollection chapterNode = doc.DocumentNode.SelectNodes("//div[@class='index_box']/dl[@class='novel_sublist2']");
414 | foreach (HtmlNode node in chapterNode)
415 | {
416 | //get current chapter number
417 | pattern = "(href=\"/)(?.+)/(?.+)/\">(?.+)(?=)";
418 | r = new Regex(pattern);
419 | m = r.Match(node.ChildNodes["dd"].OuterHtml);
420 | int current = Convert.ToInt32(m.Groups["num"].Value);
421 | details.ChapterTitle.Add(m.Groups["title"].Value);
422 |
423 | //edit href
424 | string fileName = details.FilenameFormat;
425 | fileName = String.Format(fileName + ".htm", current, details.ChapterTitle[current], details.SeriesCode);
426 | node.ChildNodes["dd"].ChildNodes["a"].Attributes["href"].Value = "./" + fileName;
427 |
428 | if (i <= Convert.ToInt32(details.End))
429 | {
430 | CheckDirectory(details, current);
431 | }
432 | i++;
433 | }
434 | sb.AppendLine(tocNode.OuterHtml);
435 |
436 | sb.AppendLine("");
437 | sb.AppendLine("");
438 |
439 | File.WriteAllText(Path.Combine(details.Path, details.SeriesTitle, details.SeriesCode + ".htm"), sb.ToString());
440 | }
441 |
442 | private static void DownloadCss(Syousetsu.Constants details, string link)
443 | {
444 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(link);
445 | request.Method = "GET";
446 | request.UserAgent = Constants.UserAgent;
447 |
448 |
449 | HttpWebResponse response = (HttpWebResponse)request.GetResponse();
450 | var stream = response.GetResponseStream();
451 |
452 | using (StreamReader reader = new StreamReader(stream))
453 | {
454 | string css = reader.ReadToEnd();
455 | File.WriteAllText(Path.Combine(details.Path, details.SeriesTitle, details.SeriesCode + ".css"), css);
456 | }
457 | }
458 |
459 | private static string CheckDirectory(Syousetsu.Constants details)
460 | {
461 | string path;
462 | if (!details.FilenameFormat.Contains('/') && !details.FilenameFormat.Contains('\\'))
463 | {
464 | path = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), details.SeriesTitle);
465 | }
466 | else
467 | {
468 | string[] temp = details.FilenameFormat
469 | .Replace("/", "\\")
470 | .Split('\\');
471 | temp = temp.Take(temp.Length - 1).ToArray();
472 | string tempFormat = (temp.Length > 1) ? String.Join("\\", temp) : temp[0];
473 |
474 | path = Path.Combine(new string[] {
475 | Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
476 | details.SeriesTitle,
477 | String.Format(tempFormat, new object[]{ 0, details.ChapterTitle[0], details.SeriesCode})
478 | });
479 | }
480 | if (!Directory.Exists(path)) { Directory.CreateDirectory(path); }
481 | return path;
482 | }
483 |
484 | private static string CheckDirectory(Syousetsu.Constants details, int current)
485 | {
486 | string path;
487 | if (!details.FilenameFormat.Contains('/') && !details.FilenameFormat.Contains('\\'))
488 | {
489 | path = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), details.SeriesTitle);
490 | }
491 | else
492 | {
493 | string[] temp = details.FilenameFormat
494 | .Replace("/", "\\")
495 | .Split('\\');
496 | temp = temp.Take(temp.Length - 1).ToArray();
497 | string tempFormat = (temp.Length > 1) ? String.Join("\\", temp) : temp[0];
498 |
499 | path = Path.Combine(new string[] {
500 | Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location),
501 | details.SeriesTitle,
502 | String.Format(tempFormat, new object[]{ current, details.ChapterTitle[current], details.SeriesCode})
503 | });
504 | }
505 | if (!Directory.Exists(path)) { Directory.CreateDirectory(path); }
506 | return path;
507 | }
508 | }
509 | }
510 |
--------------------------------------------------------------------------------
/src/DLL/CommandLine.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CommandLine
5 |
6 |
7 |
8 |
9 | Provides base properties for creating an attribute, used to define rules for command line parsing.
10 |
11 |
12 |
13 |
14 | Initializes a new instance of the class.
15 |
16 |
17 |
18 |
19 | Initializes a new instance of the class.
20 | Validating and .
21 |
22 | Short name of the option.
23 | Long name of the option.
24 |
25 |
26 |
27 | Initializes a new instance of the class. Validating
28 | and . This constructor accepts a as short name.
29 |
30 | Short name of the option.
31 | Long name of the option.
32 |
33 |
34 |
35 | Gets a short name of this command line option. You can use only one character.
36 |
37 |
38 |
39 |
40 | Gets long name of this command line option. This name is usually a single english word.
41 |
42 |
43 |
44 |
45 | Gets or sets the option's mutually exclusive set.
46 |
47 |
48 |
49 |
50 | Gets or sets a value indicating whether a command line option is required.
51 |
52 |
53 |
54 |
55 | Gets or sets mapped property default value.
56 |
57 |
58 |
59 |
60 | Gets or sets mapped property meta value.
61 |
62 |
63 |
64 |
65 | Gets or sets a short description of this command line option. Usually a sentence summary.
66 |
67 |
68 |
69 |
70 | Models an option specification.
71 |
72 |
73 |
74 |
75 | Initializes a new instance of the class.
76 | The default long name will be inferred from target property.
77 |
78 |
79 |
80 |
81 | Initializes a new instance of the class.
82 |
83 | The short name of the option..
84 |
85 |
86 |
87 | Initializes a new instance of the class.
88 |
89 | The long name of the option.
90 |
91 |
92 |
93 | Initializes a new instance of the class.
94 |
95 | The short name of the option.
96 | The long name of the option or null if not used.
97 |
98 |
99 |
100 | Helper factory method for testing purpose.
101 |
102 | An instance.
103 |
104 |
105 |
106 | Models an option that can accept multiple values as separated arguments.
107 |
108 |
109 |
110 |
111 | Initializes a new instance of the class.
112 | The default long name will be inferred from target property.
113 |
114 |
115 |
116 |
117 | Initializes a new instance of the class.
118 |
119 | The short name of the option.
120 |
121 |
122 |
123 | Initializes a new instance of the class.
124 |
125 | The long name of the option.
126 |
127 |
128 |
129 | Initializes a new instance of the class.
130 |
131 | The short name of the option.
132 | The long name of the option or null if not used.
133 |
134 |
135 |
136 | Indicates the instance method that must be invoked when it becomes necessary show your help screen.
137 | The method signature is an instance method with no parameters and
138 | return value.
139 |
140 |
141 |
142 |
143 | Initializes a new instance of the class.
144 | Although it is possible, it is strongly discouraged redefine the long name for this option
145 | not to disorient your users. It is also recommended not to define a short one.
146 |
147 |
148 |
149 |
150 | Initializes a new instance of the class
151 | with the specified short name. Use parameter less constructor instead.
152 |
153 | The short name of the option.
154 |
155 | It's highly not recommended change the way users invoke help. It may create confusion.
156 |
157 |
158 |
159 |
160 | Initializes a new instance of the class
161 | with the specified long name. Use parameter less constructor instead.
162 |
163 | The long name of the option or null if not used.
164 |
165 | It's highly not recommended change the way users invoke help. It may create confusion.
166 |
167 |
168 |
169 |
170 | Initializes a new instance of the class.
171 | Allows you to define short and long option names.
172 |
173 | The short name of the option.
174 | The long name of the option or null if not used.
175 |
176 | It's highly not recommended change the way users invoke help. It may create confusion.
177 |
178 |
179 |
180 |
181 | Returns always false for this kind of option.
182 | This behaviour can't be changed by design; if you try set
183 | an will be thrown.
184 |
185 |
186 |
187 |
188 | Models an option that can accept multiple values.
189 | Must be applied to a field compatible with an interface
190 | of instances.
191 |
192 |
193 |
194 |
195 | Initializes a new instance of the class.
196 | The default long name will be inferred from target property.
197 |
198 |
199 |
200 |
201 | Initializes a new instance of the class.
202 |
203 | The short name of the option.
204 |
205 |
206 |
207 | Initializes a new instance of the class.
208 |
209 | The long name of the option or null if not used.
210 |
211 |
212 |
213 | Initializes a new instance of the class.
214 |
215 | The short name of the option.
216 | The long name of the option or null if not used.
217 |
218 |
219 |
220 | Initializes a new instance of the class.
221 |
222 | The short name of the option or null if not used.
223 | The long name of the option or null if not used.
224 | Values separator character.
225 |
226 |
227 |
228 | Gets or sets the values separator character.
229 |
230 |
231 |
232 |
233 | Indicates that the property can receive an instance of type .
234 |
235 |
236 |
237 |
238 | Models a list of command line arguments that are not options.
239 | Must be applied to a field compatible with an interface
240 | of instances.
241 |
242 | To map individual values use instead .
243 |
244 |
245 |
246 | Initializes a new instance of the class.
247 |
248 | A type that implements .
249 | Thrown if is null.
250 |
251 |
252 |
253 | Gets or sets the maximum element allow for the list managed by type.
254 | If lesser than 0, no upper bound is fixed.
255 | If equal to 0, no elements are allowed.
256 |
257 |
258 |
259 |
260 | Gets the concrete type specified during initialization.
261 |
262 |
263 |
264 |
265 | Maps a single unnamed option to the target property. Values will be mapped in order of Index.
266 | This attribute takes precedence over with which
267 | can coexist.
268 |
269 | It can handle only scalar values. Do not apply to arrays or lists.
270 |
271 |
272 |
273 | Initializes a new instance of the class.
274 |
275 | The _index of the option.
276 |
277 |
278 |
279 | Gets the position this option has on the command line.
280 |
281 |
282 |
283 |
284 | Utility extension methods for System.Char.
285 |
286 |
287 |
288 |
289 | Utility extension methods for System.String.
290 |
291 |
292 |
293 |
294 | Gets or sets the assembly from which to pull information. Setter provided for testing purpose.
295 |
296 |
297 |
298 |
299 | Encapsulates property writing primitives.
300 |
301 |
302 |
303 |
304 | Utility extension methods for query target capabilities.
305 |
306 |
307 |
308 |
309 | Maps unnamed options to property using and .
310 |
311 |
312 |
313 |
314 | Initializes a new instance of the class. Used for unit testing purpose.
315 |
316 | Option short name.
317 | Option long name.
318 |
319 |
320 |
321 | Initializes a new instance of the class.
322 | It is internal rather than private for unit testing purpose.
323 |
324 | Initial internal capacity.
325 | Parser settings instance.
326 |
327 |
328 |
329 | Helper method for testing purpose.
330 |
331 | An argument enumerator instance.
332 | The next input value.
333 |
334 |
335 |
336 | Provides means to format an help screen.
337 | You can assign it in place of a instance.
338 |
339 |
340 |
341 |
342 | Initializes a new instance of the class.
343 |
344 |
345 |
346 |
347 | Initializes a new instance of the class
348 | specifying the sentence builder.
349 |
350 |
351 | A instance.
352 |
353 |
354 |
355 |
356 | Initializes a new instance of the class
357 | specifying heading string.
358 |
359 | An heading string or an instance of .
360 | Thrown when parameter is null or empty string.
361 |
362 |
363 |
364 | Initializes a new instance of the class
365 | specifying the sentence builder and heading string.
366 |
367 | A instance.
368 | A string with heading or an instance of .
369 |
370 |
371 |
372 | Initializes a new instance of the class
373 | specifying heading and copyright strings.
374 |
375 | A string with heading or an instance of .
376 | A string with copyright or an instance of .
377 | Thrown when one or more parameters are null or empty strings.
378 |
379 |
380 |
381 | Initializes a new instance of the class
382 | specifying heading and copyright strings.
383 |
384 | A instance.
385 | A string with heading or an instance of .
386 | A string with copyright or an instance of .
387 | Thrown when one or more parameters are null or empty strings.
388 |
389 |
390 |
391 | Initializes a new instance of the class
392 | specifying heading and copyright strings.
393 |
394 | A string with heading or an instance of .
395 | A string with copyright or an instance of .
396 | The instance that collected command line arguments parsed with class.
397 | Thrown when one or more parameters are null or empty strings.
398 |
399 |
400 |
401 | Initializes a new instance of the class
402 | specifying heading and copyright strings.
403 |
404 | A instance.
405 | A string with heading or an instance of .
406 | A string with copyright or an instance of .
407 | The instance that collected command line arguments parsed with class.
408 | Thrown when one or more parameters are null or empty strings.
409 |
410 |
411 |
412 | Occurs when an option help text is formatted.
413 |
414 |
415 |
416 |
417 | Gets or sets the heading string.
418 | You can directly assign a instance.
419 |
420 |
421 |
422 |
423 | Gets or sets the copyright string.
424 | You can directly assign a instance.
425 |
426 |
427 |
428 |
429 | Gets or sets the maximum width of the display. This determines word wrap when displaying the text.
430 |
431 | The maximum width of the display.
432 |
433 |
434 |
435 | Gets or sets a value indicating whether the format of options should contain dashes.
436 | It modifies behavior of method.
437 |
438 |
439 |
440 |
441 | Gets or sets a value indicating whether to add an additional line after the description of the option.
442 |
443 |
444 |
445 |
446 | Gets the instance specified in constructor.
447 |
448 |
449 |
450 |
451 | Creates a new instance of the class using common defaults.
452 |
453 |
454 | An instance of class.
455 |
456 | The instance that collected command line arguments parsed with class.
457 |
458 |
459 |
460 | Creates a new instance of the class using common defaults.
461 |
462 |
463 | An instance of class.
464 |
465 | The instance that collected command line arguments parsed with class.
466 | A delegate used to customize the text block for reporting parsing errors.
467 | If true the output style is consistent with verb commands (no dashes), otherwise it outputs options.
468 |
469 |
470 |
471 | Creates a new instance of the class using common defaults,
472 | for verb commands scenario.
473 |
474 |
475 | An instance of class.
476 |
477 | The instance that collected command line arguments parsed with class.
478 | The verb command invoked.
479 |
480 |
481 |
482 | Supplies a default parsing error handler implementation.
483 |
484 | The instance that collects parsed arguments parsed and associates
485 | to a property of type .
486 | The instance.
487 |
488 |
489 |
490 | Converts the help instance to a .
491 |
492 | This instance.
493 | The that contains the help screen.
494 |
495 |
496 |
497 | Adds a text line after copyright and before options usage strings.
498 |
499 | A instance.
500 | Thrown when parameter is null or empty string.
501 |
502 |
503 |
504 | Adds a text line at the bottom, after options usage string.
505 |
506 | A instance.
507 | Thrown when parameter is null or empty string.
508 |
509 |
510 |
511 | Adds a text block with options usage string.
512 |
513 | The instance that collected command line arguments parsed with class.
514 | Thrown when parameter is null.
515 |
516 |
517 |
518 | Adds a text block with options usage string.
519 |
520 | The instance that collected command line arguments parsed with the class.
521 | The word to use when the option is required.
522 | Thrown when parameter is null.
523 | Thrown when parameter is null or empty string.
524 |
525 |
526 |
527 | Adds a text block with options usage string.
528 |
529 | The instance that collected command line arguments parsed with the class.
530 | The word to use when the option is required.
531 | The maximum length of the help documentation.
532 | Thrown when parameter is null.
533 | Thrown when parameter is null or empty string.
534 |
535 |
536 |
537 | Builds a string that contains a parsing error message.
538 |
539 | An options target instance that collects parsed arguments parsed with the
540 | associated to a property of type .
541 | Number of spaces used to indent text.
542 | The that contains the parsing error message.
543 |
544 |
545 |
546 | Returns the help screen as a .
547 |
548 | The that contains the help screen.
549 |
550 |
551 |
552 | The OnFormatOptionHelpText method also allows derived classes to handle the event without attaching a delegate.
553 | This is the preferred technique for handling the event in a derived class.
554 |
555 | Data for the event.
556 |
557 |
558 |
559 | Models an abstract sentence builder.
560 |
561 |
562 |
563 |
564 | Gets a string containing word 'option'.
565 |
566 | The word 'option'.
567 |
568 |
569 |
570 | Gets a string containing the word 'and'.
571 |
572 | The word 'and'.
573 |
574 |
575 |
576 | Gets a string containing the sentence 'required option missing'.
577 |
578 | The sentence 'required option missing'.
579 |
580 |
581 |
582 | Gets a string containing the sentence 'violates format'.
583 |
584 | The sentence 'violates format'.
585 |
586 |
587 |
588 | Gets a string containing the sentence 'violates mutual exclusiveness'.
589 |
590 | The sentence 'violates mutual exclusiveness'.
591 |
592 |
593 |
594 | Gets a string containing the error heading text.
595 |
596 | The error heading text.
597 |
598 |
599 |
600 | Creates the built in sentence builder.
601 |
602 | The built in sentence builder.
603 |
604 |
605 |
606 | Models an english sentence builder, currently the default one.
607 |
608 |
609 |
610 |
611 | Gets a string containing word 'option' in english.
612 |
613 | The word 'option' in english.
614 |
615 |
616 |
617 | Gets a string containing the word 'and' in english.
618 |
619 | The word 'and' in english.
620 |
621 |
622 |
623 | Gets a string containing the sentence 'required option missing' in english.
624 |
625 | The sentence 'required option missing' in english.
626 |
627 |
628 |
629 | Gets a string containing the sentence 'violates format' in english.
630 |
631 | The sentence 'violates format' in english.
632 |
633 |
634 |
635 | Gets a string containing the sentence 'violates mutual exclusiveness' in english.
636 |
637 | The sentence 'violates mutual exclusiveness' in english.
638 |
639 |
640 |
641 | Gets a string containing the error heading text in english.
642 |
643 | The error heading text in english.
644 |
645 |
646 |
647 | Models the copyright part of an help text.
648 | You can assign it where you assign any instance.
649 |
650 |
651 |
652 |
653 | Initializes a new instance of the class
654 | specifying author and year.
655 |
656 | The company or person holding the copyright.
657 | The year of coverage of copyright.
658 | Thrown when parameter is null or empty string.
659 |
660 |
661 |
662 | Initializes a new instance of the class
663 | specifying author and copyrightYears.
664 |
665 | The company or person holding the copyright.
666 | The copyrightYears of coverage of copyright.
667 | Thrown when parameter is null or empty string.
668 | Thrown when parameter is not supplied.
669 |
670 |
671 |
672 | Initializes a new instance of the class
673 | specifying symbol case, author and copyrightYears.
674 |
675 | The case of the copyright symbol.
676 | The company or person holding the copyright.
677 | The copyrightYears of coverage of copyright.
678 | Thrown when parameter is null or empty string.
679 | Thrown when parameter is not supplied.
680 |
681 |
682 |
683 | Initializes a new instance of the class.
684 |
685 |
686 |
687 |
688 | Initializes a new instance of the class
689 | with an assembly attribute, this overrides all formatting.
690 |
691 | The attribute which text to use.
692 |
693 |
694 |
695 | Gets the default copyright information.
696 | Retrieved from , if it exists,
697 | otherwise it uses as copyright holder with the current year.
698 | If neither exists it throws an .
699 |
700 |
701 |
702 |
703 | Gets a different copyright word when overridden in a derived class.
704 |
705 |
706 |
707 |
708 | Converts the copyright instance to a .
709 |
710 | This instance.
711 | The that contains the copyright.
712 |
713 |
714 |
715 | Returns the copyright as a .
716 |
717 | The that contains the copyright.
718 |
719 |
720 |
721 | When overridden in a derived class, allows to specify a new algorithm to render copyright copyrightYears
722 | as a instance.
723 |
724 | A array of copyrightYears.
725 | A instance with copyright copyrightYears.
726 |
727 |
728 |
729 | Models the heading part of an help text.
730 | You can assign it where you assign any instance.
731 |
732 |
733 |
734 |
735 | Initializes a new instance of the class
736 | specifying program name.
737 |
738 | The name of the program.
739 | Thrown when parameter is null or empty string.
740 |
741 |
742 |
743 | Initializes a new instance of the class
744 | specifying program name and version.
745 |
746 | The name of the program.
747 | The version of the program.
748 | Thrown when parameter is null or empty string.
749 |
750 |
751 |
752 | Gets the default heading instance.
753 | The title is retrieved from ,
754 | or the assembly short name if its not defined.
755 | The version is retrieved from ,
756 | or the assembly version if its not defined.
757 |
758 |
759 |
760 |
761 | Converts the heading to a .
762 |
763 | This instance.
764 | The that contains the heading.
765 |
766 |
767 |
768 | Returns the heading as a .
769 |
770 | The that contains the heading.
771 |
772 |
773 |
774 | Writes out a string and a new line using the program name specified in the constructor
775 | and parameter.
776 |
777 | The message to write.
778 | The target derived type.
779 | Thrown when parameter is null or empty string.
780 | Thrown when parameter is null.
781 |
782 |
783 |
784 | Writes out a string and a new line using the program name specified in the constructor
785 | and parameter to standard output stream.
786 |
787 | The message to write.
788 | Thrown when parameter is null or empty string.
789 |
790 |
791 |
792 | Writes out a string and a new line using the program name specified in the constructor
793 | and parameter to standard error stream.
794 |
795 | The message to write.
796 | Thrown when parameter is null or empty string.
797 |
798 |
799 |
800 | Provides data for the FormatOptionHelpText event.
801 |
802 |
803 |
804 |
805 | Initializes a new instance of the class.
806 |
807 | Option to format.
808 |
809 |
810 |
811 | Gets the option to format.
812 |
813 |
814 |
815 |
816 | Provides base properties for creating an attribute, used to define multiple lines of text.
817 |
818 |
819 |
820 |
821 | Initializes a new instance of the class. Used in derived type
822 | using one line of text.
823 |
824 | The first line of text.
825 |
826 |
827 |
828 | Initializes a new instance of the class. Used in type
829 | using two lines of text.
830 |
831 | The first line of text.
832 | The second line of text.
833 |
834 |
835 |
836 | Initializes a new instance of the class. Used in type
837 | using three lines of text.
838 |
839 | The first line of text.
840 | The second line of text.
841 | The third line of text.
842 |
843 |
844 |
845 | Initializes a new instance of the class. Used in type
846 | using four lines of text.
847 |
848 | The first line of text.
849 | The second line of text.
850 | The third line of text.
851 | The fourth line of text.
852 |
853 |
854 |
855 | Initializes a new instance of the class. Used in type
856 | using five lines of text.
857 |
858 | The first line of text.
859 | The second line of text.
860 | The third line of text.
861 | The fourth line of text.
862 | The fifth line of text.
863 |
864 |
865 |
866 | Gets the all non-blank lines as string.
867 |
868 | A string of all non-blank lines.
869 |
870 |
871 |
872 | Gets the first line of text.
873 |
874 |
875 |
876 |
877 | Gets the second line of text.
878 |
879 |
880 |
881 |
882 | Gets third line of text.
883 |
884 |
885 |
886 |
887 | Gets the fourth line of text.
888 |
889 |
890 |
891 |
892 | Gets the fifth line of text.
893 |
894 |
895 |
896 |
897 | Returns the last line with text. Preserves blank lines if user intended by skipping a line.
898 |
899 | The last index of line of the non-blank line.
900 |
901 | The string array to process.
902 |
903 |
904 |
905 | Models a multiline assembly license text.
906 |
907 |
908 |
909 |
910 | Initializes a new instance of the class
911 | with one line of text.
912 |
913 | First line of license text.
914 |
915 |
916 |
917 | Initializes a new instance of the class
918 | with two lines of text.
919 |
920 | First line of license text.
921 | Second line of license text.
922 |
923 |
924 |
925 | Initializes a new instance of the class
926 | with three lines of text.
927 |
928 | First line of license text.
929 | Second line of license text.
930 | Third line of license text.
931 |
932 |
933 |
934 | Initializes a new instance of the class
935 | with four lines of text.
936 |
937 | First line of license text.
938 | Second line of license text.
939 | Third line of license text.
940 | Fourth line of license text.
941 |
942 |
943 |
944 | Initializes a new instance of the class
945 | with five lines of text.
946 |
947 | First line of license text.
948 | Second line of license text.
949 | Third line of license text.
950 | Fourth line of license text.
951 | Fifth line of license text.
952 |
953 |
954 |
955 | Models a multiline assembly usage text.
956 |
957 |
958 |
959 |
960 | Initializes a new instance of the class
961 | with one line of text.
962 |
963 | First line of usage text.
964 |
965 |
966 |
967 | Initializes a new instance of the class
968 | with two lines of text.
969 |
970 | First line of usage text.
971 | Second line of usage text.
972 |
973 |
974 |
975 | Initializes a new instance of the class
976 | with three lines of text.
977 |
978 | First line of usage text.
979 | Second line of usage text.
980 | Third line of usage text.
981 |
982 |
983 |
984 | Initializes a new instance of the class
985 | with four lines of text.
986 |
987 | First line of usage text.
988 | Second line of usage text.
989 | Third line of usage text.
990 | Fourth line of usage text.
991 |
992 |
993 |
994 | Initializes a new instance of the class
995 | with five lines of text.
996 |
997 | First line of usage text.
998 | Second line of usage text.
999 | Third line of usage text.
1000 | Fourth line of usage text.
1001 | Fifth line of usage text.
1002 |
1003 |
1004 |
1005 | Indicates the instance method that must be invoked when it becomes necessary show your help screen.
1006 | The method signature is an instance method with that accepts and returns a .
1007 |
1008 |
1009 |
1010 |
1011 | Initializes a new instance of the class.
1012 | Although it is possible, it is strongly discouraged redefine the long name for this option
1013 | not to disorient your users.
1014 |
1015 |
1016 |
1017 |
1018 | Initializes a new instance of the class
1019 | with the specified long name. Use parameter less constructor instead.
1020 |
1021 | Help verb option alternative name.
1022 |
1023 | It's highly not recommended change the way users invoke help. It may create confusion.
1024 |
1025 |
1026 |
1027 |
1028 | Help verb command do not support short name by design.
1029 |
1030 |
1031 |
1032 |
1033 | Help verb command like ordinary help option cannot be mandatory by design.
1034 |
1035 |
1036 |
1037 |
1038 | Models a verb command specification.
1039 |
1040 |
1041 |
1042 |
1043 | Initializes a new instance of the class.
1044 |
1045 | The long name of the verb command.
1046 |
1047 |
1048 |
1049 | Verb commands do not support short name by design.
1050 |
1051 |
1052 |
1053 |
1054 | Verb commands cannot be mandatory since are mutually exclusive by design.
1055 |
1056 |
1057 |
1058 |
1059 | Models a bad parsed option.
1060 |
1061 |
1062 |
1063 |
1064 | Gets the short name of the option.
1065 |
1066 | Returns the short name of the option.
1067 |
1068 |
1069 |
1070 | Gets the long name of the option.
1071 |
1072 | Returns the long name of the option.
1073 |
1074 |
1075 |
1076 | Provides methods to parse command line arguments.
1077 |
1078 |
1079 |
1080 |
1081 | Default exit code (1) used by
1082 | and overloads.
1083 |
1084 |
1085 |
1086 |
1087 | Initializes a new instance of the class.
1088 |
1089 |
1090 |
1091 |
1092 | Initializes a new instance of the class,
1093 | configurable with a object.
1094 |
1095 | The object is used to configure
1096 | aspects and behaviors of the parser.
1097 |
1098 |
1099 |
1100 | Initializes a new instance of the class,
1101 | configurable with using a delegate.
1102 |
1103 | The delegate used to configure
1104 | aspects and behaviors of the parser.
1105 |
1106 |
1107 |
1108 | Finalizes an instance of the class.
1109 |
1110 |
1111 |
1112 |
1113 | Gets the singleton instance created with basic defaults.
1114 |
1115 |
1116 |
1117 |
1118 | Gets the instance that implements in use.
1119 |
1120 |
1121 |
1122 |
1123 | Parses a array of command line arguments, setting values in
1124 | parameter instance's public fields decorated with appropriate attributes.
1125 |
1126 | A array of command line arguments.
1127 | An instance used to receive values.
1128 | Parsing rules are defined using derived types.
1129 | True if parsing process succeed.
1130 | Thrown if is null.
1131 | Thrown if is null.
1132 |
1133 |
1134 |
1135 | Parses a array of command line arguments with verb commands, setting values in
1136 | parameter instance's public fields decorated with appropriate attributes.
1137 | This overload supports verb commands.
1138 |
1139 | A array of command line arguments.
1140 | An instance used to receive values.
1141 | Parsing rules are defined using derived types.
1142 | Delegate executed to capture verb command name and instance.
1143 | True if parsing process succeed.
1144 | Thrown if is null.
1145 | Thrown if is null.
1146 | Thrown if is null.
1147 |
1148 |
1149 |
1150 | Parses a array of command line arguments, setting values in
1151 | parameter instance's public fields decorated with appropriate attributes. If parsing fails, the method invokes
1152 | the delegate, if null exits with .
1153 |
1154 | A array of command line arguments.
1155 | An object's instance used to receive values.
1156 | Parsing rules are defined using derived types.
1157 | The delegate executed when parsing fails.
1158 | True if parsing process succeed.
1159 | Thrown if is null.
1160 | Thrown if is null.
1161 |
1162 |
1163 |
1164 | Parses a array of command line arguments with verb commands, setting values in
1165 | parameter instance's public fields decorated with appropriate attributes. If parsing fails, the method invokes
1166 | the delegate, if null exits with .
1167 | This overload supports verb commands.
1168 |
1169 | A array of command line arguments.
1170 | An instance used to receive values.
1171 | Parsing rules are defined using derived types.
1172 | Delegate executed to capture verb command name and instance.
1173 | The delegate executed when parsing fails.
1174 | True if parsing process succeed.
1175 | Thrown if is null.
1176 | Thrown if is null.
1177 | Thrown if is null.
1178 |
1179 |
1180 |
1181 | Frees resources owned by the instance.
1182 |
1183 |
1184 |
1185 |
1186 | This exception is thrown when a generic parsing error occurs.
1187 |
1188 |
1189 |
1190 |
1191 | Initializes a new instance of the class. The exception is thrown
1192 | when something unexpected occurs during the parsing process.
1193 |
1194 |
1195 |
1196 |
1197 | Initializes a new instance of the class. The exception is thrown
1198 | when something unexpected occurs during the parsing process.
1199 |
1200 | Error message string.
1201 |
1202 |
1203 |
1204 | Initializes a new instance of the class. The exception is thrown
1205 | when something unexpected occurs during the parsing process.
1206 |
1207 | Error message string.
1208 | Inner exception reference.
1209 |
1210 |
1211 |
1212 | Initializes a new instance of the class. The exception is thrown
1213 | when something unexpected occurs during the parsing process.
1214 |
1215 | The object that holds the serialized object data.
1216 | The contextual information about the source or destination.
1217 |
1218 |
1219 |
1220 | Provides settings for . Once consumed cannot be reused.
1221 |
1222 |
1223 |
1224 |
1225 | Initializes a new instance of the class.
1226 |
1227 |
1228 |
1229 |
1230 | Initializes a new instance of the class,
1231 | setting the case comparison behavior.
1232 |
1233 | If set to true, parsing will be case sensitive.
1234 |
1235 |
1236 |
1237 | Initializes a new instance of the class,
1238 | setting the used for help method output.
1239 |
1240 | Any instance derived from ,
1241 | default . Setting this argument to null, will disable help screen.
1242 |
1243 |
1244 |
1245 | Initializes a new instance of the class,
1246 | setting case comparison and help output options.
1247 |
1248 | If set to true, parsing will be case sensitive.
1249 | Any instance derived from ,
1250 | default . Setting this argument to null, will disable help screen.
1251 |
1252 |
1253 |
1254 | Initializes a new instance of the class,
1255 | setting case comparison and mutually exclusive behaviors.
1256 |
1257 | If set to true, parsing will be case sensitive.
1258 | If set to true, enable mutually exclusive behavior.
1259 |
1260 |
1261 |
1262 | Initializes a new instance of the class,
1263 | setting case comparison, mutually exclusive behavior and help output option.
1264 |
1265 | If set to true, parsing will be case sensitive.
1266 | If set to true, enable mutually exclusive behavior.
1267 | Any instance derived from ,
1268 | default . Setting this argument to null, will disable help screen.
1269 |
1270 |
1271 |
1272 | Initializes a new instance of the class,
1273 | setting case comparison, mutually exclusive behavior and help output option.
1274 |
1275 | If set to true, parsing will be case sensitive.
1276 | If set to true, enable mutually exclusive behavior.
1277 | If set to true, allow the parser to skip unknown argument, otherwise return a parse failure
1278 | Any instance derived from ,
1279 | default . Setting this argument to null, will disable help screen.
1280 |
1281 |
1282 |
1283 | Finalizes an instance of the class.
1284 |
1285 |
1286 |
1287 |
1288 | Gets or sets a value indicating whether perform case sensitive comparisons.
1289 |
1290 |
1291 |
1292 |
1293 | Gets or sets a value indicating whether set a mutually exclusive behavior.
1294 | Default is set to false.
1295 |
1296 |
1297 |
1298 |
1299 | Gets or sets the used for help method output.
1300 | Setting this property to null, will disable help screen.
1301 |
1302 |
1303 |
1304 |
1305 | Gets or sets a value indicating whether the parser shall move on to the next argument and ignore the given argument if it
1306 | encounter an unknown arguments
1307 |
1308 |
1309 | true to allow parsing the arguments with different class options that do not have all the arguments.
1310 |
1311 |
1312 | This allows fragmented version class parsing, useful for project with add-on where add-ons also requires command line arguments but
1313 | when these are unknown by the main program at build time.
1314 |
1315 |
1316 |
1317 |
1318 | Gets or sets the culture used when parsing arguments to typed properties.
1319 |
1320 |
1321 | Default is CurrentCulture of .
1322 |
1323 |
1324 |
1325 |
1326 | Frees resources owned by the instance.
1327 |
1328 |
1329 |
1330 |
1331 | Represents the parser state.
1332 |
1333 |
1334 |
1335 |
1336 | Gets errors occurred during parsing.
1337 |
1338 |
1339 |
1340 |
1341 | Models a type that records the parser state after parsing.
1342 |
1343 |
1344 |
1345 |
1346 | Gets a list of parsing errors.
1347 |
1348 |
1349 | Parsing errors.
1350 |
1351 |
1352 |
1353 |
1354 | Models a parsing error.
1355 |
1356 |
1357 |
1358 |
1359 | Gets or a the bad parsed option.
1360 |
1361 |
1362 | The bad option.
1363 |
1364 |
1365 |
1366 |
1367 | Gets or sets a value indicating whether this violates required.
1368 |
1369 |
1370 | true if violates required; otherwise, false.
1371 |
1372 |
1373 |
1374 |
1375 | Gets or sets a value indicating whether this violates format.
1376 |
1377 |
1378 | true if violates format; otherwise, false.
1379 |
1380 |
1381 |
1382 |
1383 | Gets or sets a value indicating whether this violates mutual exclusiveness.
1384 |
1385 |
1386 | true if violates mutual exclusiveness; otherwise, false.
1387 |
1388 |
1389 |
1390 |
1391 |
--------------------------------------------------------------------------------