1 <Type Name="Option" FullName="Mono.Options.Option">
2 <TypeSignature Language="C#" Value="public abstract class Option" />
4 <AssemblyName>Mono.Options</AssemblyName>
5 <AssemblyVersion>0.2.0.0</AssemblyVersion>
6 <AssemblyVersion>0.2.1.0</AssemblyVersion>
8 <ThreadingSafetyStatement>
9 All members of this type are safe for multithreaded operations.
10 Subclasses must be thread-safe if multithreaded invocation of
11 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable<System.String>)" />
13 </ThreadingSafetyStatement>
15 <BaseTypeName>System.Object</BaseTypeName>
20 Represents information about an option.
24 Instances of <see cref="T:Mono.Options.Option" /> are created via
25 the various <see cref="M:Mono.Options.OptionSet.Add" /> overloads,
31 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.Action{System.String})" />
36 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.String,System.Action{System.String})" />
41 <see cref="M:Mono.Options.OptionSet.Add(System.String,Mono.Options.OptionAction{System.String,System.String})" />
46 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.String,Mono.Options.OptionAction{System.String,System.String})" />
51 <see cref="M:Mono.Options.OptionSet.Add``1(System.String,System.Action{``0})" />
56 <see cref="M:Mono.Options.OptionSet.Add``1(System.String,System.String,System.Action{``0})" />
61 <see cref="M:Mono.Options.OptionSet.Add``2(System.String,Mono.Options.OptionAction{``0,``1})" />
66 <see cref="M:Mono.Options.OptionSet.Add``2(System.String,System.String,Mono.Options.OptionAction{``0,``1})" />
71 You can also add custom <see cref="T:Mono.Options.Option" />
72 subclasses to an <see cref="T:Mono.Options.OptionSet" /> via the
73 <see cref="M:Mono.Options.OptionSet.Add(Mono.Options.Option)" />
76 <block subset="none" type="overrides">
77 Inheritors of this type must override the <see langword="abstract" /> method
78 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />,
79 which is (indirectly) invoked from within
80 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
81 when an option matching one of the <paramref name="prototype" />
82 aliases is encountered.
87 <Member MemberName=".ctor">
88 <MemberSignature Language="C#" Value="protected Option (string prototype, string description);" />
89 <MemberType>Constructor</MemberType>
91 <AssemblyVersion>0.2.0.0</AssemblyVersion>
92 <AssemblyVersion>0.2.1.0</AssemblyVersion>
95 <Parameter Name="prototype" Type="System.String" />
96 <Parameter Name="description" Type="System.String" />
99 <param name="prototype">
100 A <see cref="T:System.String" /> containing a <c>|</c>-separated
101 list of option names (aliases) and an optional value-type specifier.
103 <param name="description">
104 A <see cref="T:System.String" /> containing documentation for the
108 Creates and initializes a new instance of the
109 <see cref="T:Mono.Options.Option" /> class.
113 This constructor initializes the
114 <see cref="P:Mono.Options.Option.Prototype" /> property of the
115 new instance using <paramref name="prototype" />, the
116 <see cref="P:Mono.Options.Option.Description" /> property of the
117 new instance using <paramref name="description" />. and
118 initializes the <see cref="P:Mono.Options.Option.MaxValueCount" />
119 property of the new instance to <c>1</c>.
122 This is equivalent to calling the
123 <see cref="C:Mono.Options.Option(System.String,System.String,System.Int32)" />
124 constructor as with <c>Option(<paramref name="prototype" />,
125 <paramref name="description" />, 1)</c>.
128 <exception cref="T:System.ArgumentException">
130 <paramref name="prototype" /> is the empty string <c>""</c>.
134 <paramref name="prototype" /> contains an empty alias, such as
139 Conflicting <see cref="T:Mono.Options.OptionValueType" /> values
140 were found within <paramref name="prototype" />.
144 <paramref name="prototype" /> only includes the default handler
145 <c><></c> and <paramref name="prototype" /> did not specify an
146 <see cref="T:Mono.Options.OptionValueType" /> value of
147 <see cref="F:Mono.Options.OptionValueType.None" />.
150 <exception cref="T:System.ArgumentNullException">
151 <paramref name="prototype" /> is <see langword="null" />.
155 <Member MemberName=".ctor">
156 <MemberSignature Language="C#" Value="protected Option (string prototype, string description, int maxValueCount);" />
157 <MemberType>Constructor</MemberType>
159 <AssemblyVersion>0.2.0.0</AssemblyVersion>
160 <AssemblyVersion>0.2.1.0</AssemblyVersion>
163 <Parameter Name="prototype" Type="System.String" />
164 <Parameter Name="description" Type="System.String" />
165 <Parameter Name="maxValueCount" Type="System.Int32" />
168 <param name="prototype">
169 A <see cref="T:System.String" /> containing a <c>|</c>-separated
170 list of option names (aliases) and an optional value-type specifier.
172 <param name="description">
173 A <see cref="T:System.String" /> containing documentation for the
176 <param name="maxValueCount">
177 A <see cref="T:System.Int32" /> containing the number of values this
181 Creates and initializes a new instance of the
182 <see cref="T:Mono.Options.Option" /> class.
186 This constructor initializes the
187 <see cref="P:Mono.Options.Option.Prototype" /> property of the
188 new instance using <paramref name="prototype" />, the
189 <see cref="P:Mono.Options.Option.Description" /> property of the
190 new instance using <paramref name="description" />. and
191 initializes the <see cref="P:Mono.Options.Option.MaxValueCount" />
192 property of the new instance using <paramref name="maxValueCount" />.
195 <paramref name="prototype" /> is a <c>|</c>-separated list of
196 option names. It should be listed in shortest-to-longest order,
197 e.g. <c>h|help</c>. <paramref name="prototype" /> may contain a
198 <see cref="T:Mono.Options.OptionValueType" /> specifier following
199 one of the <c>|</c>-separated entries, and a value separator list
200 following the <see cref="T:Mono.Options.OptionValueType" />
204 The <see cref="P:Mono.Options.Option.OptionValueType" /> property
205 is initialized based on whether a <c>=</c> or <c>:</c> follows one
206 of the aliases within <paramref name="prototype" />.
208 <see cref="F:Mono.Options.OptionValueType.Required" /> value,
209 while <c>:</c> specifies an
210 <see cref="F:Mono.Options.OptionValueType.Optional" /> value.
211 If neither <c>=</c> nor <c>:</c> is not specified, then
212 <see cref="F:Mono.Options.OptionValueType.None" /> is used.
213 The value specifier may be used anywhere within
214 <paramref name="prototype" />, so <c>n|name=</c>, <c>n=|name</c>
215 and <c>n=|name=</c> are equivalent, but you cannot mix types;
216 <c>n:|name=</c> is invalid.
219 A default handler may be specified by using <c><></c> as the
220 option name. The default handler is invoked for any unhandled
222 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />;
223 consequently, if a default handler is provided then
224 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
226 <see cref="T:System.Collections.Generic.List{System.String}" />.
229 The default handler may either be provided as a stand-alone
230 <see cref="T:Mono.Options.Option" />, in which case it may not
231 specify a <see cref="T:Mono.Options.OptionValueType" /> other
232 than <see cref="F:Mono.Options.OptionValueType.None" />.
233 Alternatively, it may be an alias, in which case the
234 <see cref="T:Mono.Options.Option" /> must accept an
235 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
236 <see cref="F:Mono.Options.OptionValueType.Required" /> value, and
237 <paramref name="maxValueCount" /> must be <c>1</c>.
240 Multiple values may be bundled together, such as
241 <c>-opt key=value</c>. The value separator list specifies which
242 characters can be used to split the value argument to generate
243 separate values. The value separator list is available when
244 <paramref name="maxValueCount" /> is greater than <c>1</c>, and
245 and an <see cref="T:Mono.Options.OptionValueType" /> was
246 specified. The value separator list follows the <c>=</c> or
247 <c>:</c> and is one of the following:
253 A sequence of character enclosed by <c>{</c> and <c>}</c>.
254 Multiple such sequences may be specified by listing the
255 <c>{...}</c> sequence multiple times.
258 The sequence <c>{}</c> requires that each value be a different
259 argument, and no argument splitting will be performed.
260 This sequence has no effect if other separators are also
261 listed (as separate arguments are always permitted for
262 <see cref="F:Mono.Options.OptionValueType.Required" />
269 Any literal character other than <c>{</c> and <c>}</c>.
274 If the separator list is not provided, then <c>=:</c> is the
275 default separator list.
278 For example, the prototype <c>"A:+-*/"</c> would permit any of
279 `<c>+</c>', `<c>-</c>', `<c>*</c>', or `<c>/</c>' to be used to
280 split an argument into values, so <c>-A:5/2</c> would generate the
281 sequence of values <c>5</c> and <c>2</c> for the option <c>-A</c>.
282 Furthermore, the prototype <c>"A={-->}{=>}"</c> would permit
283 either the string <c>--></c> or the string <c>=></c> to be used,
284 so <c>-A A->B C</c> woud parse <c>A->B</c> as one value and
285 <c>C</c> as the other value, while <c>-A A-->B C</c> would parse
286 <c>A</c> as one value and <c>B</c> as the other value while
287 <c>C</c> would be unhandled (unless the option required 3 values,
288 in which case <c>C</c> would be the 3rd value).
291 <exception cref="T:System.ArgumentException">
293 <paramref name="prototype" /> is the empty string <c>""</c>.
297 <paramref name="prototype" /> contains an empty alias, such as
302 Conflicting <see cref="T:Mono.Options.OptionValueType" /> values
303 were found within <paramref name="prototype" />.
307 <paramref name="maxValueCount" /> is <c>0</c> and
308 <paramref name="prototype" /> specified an
309 <see cref="T:Mono.Options.OptionValueType" /> value of
310 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
311 <see cref="F:Mono.Options.OptionValueType.Required" />.
315 <paramref name="maxValueCount" /> is greater than <c>1</c> and
316 <paramref name="prototype" /> specified an
317 <see cref="T:Mono.Options.OptionValueType" /> value of
318 <see cref="F:Mono.Options.OptionValueType.None" />.
322 <paramref name="prototype" /> contains a separator list and
323 <paramref name="maxValueCount" /> is <c>0</c> or <c>1</c>.
327 <paramref name="prototype" /> contains a badly formatted
328 separator list, such as <c>{{</c>, <c>}}</c>, <c>{{}</c>, etc.
332 <paramref name="prototype" /> only includes the default handler
333 <c><></c> and <paramref name="prototype" /> did not specify an
334 <see cref="T:Mono.Options.OptionValueType" /> value of
335 <see cref="F:Mono.Options.OptionValueType.None" />.
339 <paramref name="prototype" /> includes the default handler
340 <c><></c>, and <paramref name="MaxValueCount" /> is greater
344 <exception cref="T:System.ArgumentNullException">
345 <paramref name="prototype" /> is <see langword="null" />.
349 <Member MemberName="Description">
350 <MemberSignature Language="C#" Value="public string Description { get; }" />
351 <MemberType>Property</MemberType>
353 <AssemblyVersion>0.2.0.0</AssemblyVersion>
354 <AssemblyVersion>0.2.1.0</AssemblyVersion>
357 <ReturnType>System.String</ReturnType>
361 A <see cref="T:System.String" /> containing documentation for this
365 A <see cref="T:System.String" /> containing documentation for this
369 This property is used to generate documentation within
370 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
371 The string returned is translated via the
372 <paramref name="localizer" /> parameter provided to the
373 <see cref="C:Mono.Options.OptionSet(System.Converter{System.String,System.String})" />
374 constructor before being written to the
375 <see cref="T:System.IO.TextWriter" /> instance.
377 <altmember cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />
380 <Member MemberName="GetNames">
381 <MemberSignature Language="C#" Value="public string[] GetNames ();" />
382 <MemberType>Method</MemberType>
384 <AssemblyVersion>0.2.0.0</AssemblyVersion>
385 <AssemblyVersion>0.2.1.0</AssemblyVersion>
388 <ReturnType>System.String[]</ReturnType>
392 <summary>Retrieves all name aliases that make up
393 <see cref="P:Mono.Options.Option.Prototype" />.</summary>
395 A <see cref="T:System.String" /> array containing all name aliases
396 for this <see cref="T:Mono.Options.Option" /> instance.
399 The returned option names will not contain any
400 <see cref="T:Mono.Options.OptionValueType" /> specifier that may be
401 within <see cref="P:Mono.Options.Option.Prototype" />.
402 If <see cref="P:Mono.Options.Option.Prototype" /> is
403 <c>a=|b=|c=</c>, the array returned will contain <c>a</c>, <c>b</c>,
408 <Member MemberName="GetValueSeparators">
409 <MemberSignature Language="C#" Value="public string[] GetValueSeparators ();" />
410 <MemberType>Method</MemberType>
412 <AssemblyVersion>0.2.0.0</AssemblyVersion>
413 <AssemblyVersion>0.2.1.0</AssemblyVersion>
416 <ReturnType>System.String[]</ReturnType>
421 Retreives all value separators, strings which are used to split an
422 argument into one or more values for the this
423 <see cref="T:Mono.Options.Option" />.
426 A <see cref="T:System.String" /> array containing all strings that
427 should be used when splitting an argument into one or more values
428 for this <see cref="T:Mono.Options.Option" />.
432 Value separators may be provided within
433 <see cref="P:Mono.Options.Option.Prototype" /> only if:
438 <see cref="P:Mono.Options.Option.MaxValueCount" /> is greater than 1.
443 <see cref="P:Mono.Options.Option.OptionValueType" /> is
444 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
445 <see cref="F:Mono.Options.OptionValueType.Required" />.
451 <see cref="C:Mono.Options.Option(System.String,System.String,System.Int32)" />
452 constructor for more information.
457 <Member MemberName="Invoke">
458 <MemberSignature Language="C#" Value="public void Invoke (Mono.Options.OptionContext c);" />
459 <MemberType>Method</MemberType>
461 <AssemblyVersion>0.2.0.0</AssemblyVersion>
462 <AssemblyVersion>0.2.1.0</AssemblyVersion>
465 <ReturnType>System.Void</ReturnType>
468 <Parameter Name="c" Type="Mono.Options.OptionContext" />
472 An <see cref="T:Mono.Options.OptionContext" /> instance containing
473 information about the option that was parsed.
477 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
478 then clears out <paramref name="c" />.
482 This method is invoked from within
483 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
484 when an option with a name from
485 <see cref="M:Mono.Options.Option.GetNames" /> is encountered and
486 matches the required number of values governed by
487 <see cref="P:Mono.Options.Option.OptionValueType" /> and
488 <see cref="P:Mono.Options.Option.MaxValueCount" />.
490 <block subset="none" type="behaviors">
493 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />,
494 passing along <paramref name="c" /> unchanged, and then sets the
495 <see cref="P:Mono.Options.OptionContext.Option" /> and
496 <see cref="P:Mono.Options.OptionContext.OptionName" />
497 properties to <see langword="null" />, and
498 <see cref="M:Mono.Options.OptionValueCollection.Clear" />s out
499 <see cref="P:Mono.Options.OptionContext.OptionValues" />.
503 <altmember cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
504 <altmember cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
505 <altmember cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
508 <Member MemberName="MaxValueCount">
509 <MemberSignature Language="C#" Value="public int MaxValueCount { get; }" />
510 <MemberType>Property</MemberType>
512 <AssemblyVersion>0.2.0.0</AssemblyVersion>
513 <AssemblyVersion>0.2.1.0</AssemblyVersion>
516 <ReturnType>System.Int32</ReturnType>
520 A <see cref="T:System.Int32" /> containing the maximum number of
521 values this <see cref="T:Mono.Options.Option" /> accepts.
524 A <see cref="T:System.Int32" /> containing the maximum number of
525 values this <see cref="T:Mono.Options.Option" /> accepts.
529 This is a maximum, and may not be the number of values present
530 within <see cref="P:Mono.Options.OptionContext.OptionValues" />
532 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
533 is invoked. There will be
534 <see cref="P:Mono.Options.Option.MaxValueCount" /> values if
535 <see cref="P:Mono.Options.Option.OptionValueType" /> is
536 <see cref="F:Mono.Options.OptionValueType.Required" />, but if
537 <see cref="P:Mono.Options.Option.OptionValueType" /> is
538 <see cref="F:Mono.Options.OptionValueType.Optional" /> then
539 <see cref="P:Mono.Options.OptionContext.OptionValues" /> may
545 <Member MemberName="OnParseComplete">
546 <MemberSignature Language="C#" Value="protected abstract void OnParseComplete (Mono.Options.OptionContext c);" />
547 <MemberType>Method</MemberType>
549 <AssemblyVersion>0.2.0.0</AssemblyVersion>
550 <AssemblyVersion>0.2.1.0</AssemblyVersion>
553 <ReturnType>System.Void</ReturnType>
556 <Parameter Name="c" Type="Mono.Options.OptionContext" />
560 An <see cref="T:Mono.Options.OptionContext" /> instance containing
561 information about the option that was parsed.
564 Perform an action when an option is parsed.
568 This method must be overridden by all subclasses, within which the
569 subclass can perform some custom per-option processing.
572 This method is invoked from within
573 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
574 when an option with a name from
575 <see cref="M:Mono.Options.Option.GetNames" /> is encountered and
576 matches the required number of values governed by
577 <see cref="P:Mono.Options.Option.OptionValueType" /> and
578 <see cref="P:Mono.Options.Option.MaxValueCount" />.
583 The following example has a custom
584 <see cref="T:Mono.Options.Option" /> subclass which overrides
585 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />:
587 <code lang="C#" src="examples/subclass.cs">// Case-Insensitive and Concatenating OptionSet
589 using System.Collections.Generic;
592 class DemoOptionSet : OptionSet {
593 protected override void InsertItem (int index, Option item)
595 if (item.Prototype.ToLower () != item.Prototype)
596 throw new ArgumentException ("prototypes must be lower-case!");
597 base.InsertItem (index, item);
600 protected override OptionContext CreateOptionContext ()
602 return new OptionContext (this);
605 protected override bool Parse (string option, OptionContext c)
608 bool haveParts = GetOptionParts (option, out f, out n, out s, out v);
609 Option nextOption = null;
610 string newOption = option;
613 string nl = n.ToLower ();
614 nextOption = Contains (nl) ? this [nl] : null;
615 newOption = f + n.ToLower () + (v != null ? s + v : "");
618 if (c.Option != null) {
620 if (c.Option != null && haveParts) {
621 if (nextOption == null) {
625 throw new OptionException (
626 string.Format ("Found option `{0}' as value for option `{1}'.",
627 option, c.OptionName), c.OptionName);
630 // have a option w/ required value; try to concat values.
631 if (AppendValue (option, c)) {
632 if (!option.EndsWith ("\\") &&
633 c.Option.MaxValueCount == c.OptionValues.Count) {
639 base.Parse (newOption, c);
642 if (!haveParts || v == null) {
643 // Not an option; let base handle as a non-option argument.
644 return base.Parse (newOption, c);
647 if (nextOption.OptionValueType != OptionValueType.None &&
649 c.Option = nextOption;
650 c.OptionValues.Add (v);
651 c.OptionName = f + n;
655 return base.Parse (newOption, c);
658 private bool AppendValue (string value, OptionContext c)
661 string[] seps = c.Option.GetValueSeparators ();
662 foreach (var o in seps.Length != 0
663 ? value.Split (seps, StringSplitOptions.None)
664 : new string[]{value}) {
665 int idx = c.OptionValues.Count-1;
666 if (idx == -1 || !c.OptionValues [idx].EndsWith ("\\")) {
667 c.OptionValues.Add (o);
671 c.OptionValues [idx] += value;
680 public static void Main (string[] args)
682 List<string> names = new List<string> ();
683 Dictionary<string,string> map = new Dictionary<string,string> ();
686 OptionSet p = new DemoOptionSet () {
687 { "n|name=", v => names.Add (v) },
688 { "r|repeat:", (int v) => repeat = v },
689 { "m|map=", (k,v) => map.Add (k, v) },
692 List<string> extra;
694 extra = p.Parse (args);
696 catch (OptionException e) {
697 Console.Write ("subclass: ");
698 Console.WriteLine (e.Message);
703 if (extra.Count > 0) {
704 message = string.Join (" ", extra.ToArray ());
707 message = "Hello {0}!";
710 foreach (string name in names) {
711 for (int i = 0; i < repeat; ++i)
712 Console.WriteLine (message, name);
714 List<string> keys = new List<string>(map.Keys);
716 foreach (string key in keys) {
717 Console.WriteLine ("Key: {0}={1}", key, map [key]);
724 See <see cref="T:Mono.Options.OptionSet" /> for more on this
728 <altmember cref="M:Mono.Options.Option.Invoke(Mono.Options.OptionContext)" />
731 <Member MemberName="OptionValueType">
732 <MemberSignature Language="C#" Value="public Mono.Options.OptionValueType OptionValueType { get; }" />
733 <MemberType>Property</MemberType>
735 <AssemblyVersion>0.2.0.0</AssemblyVersion>
736 <AssemblyVersion>0.2.1.0</AssemblyVersion>
739 <ReturnType>Mono.Options.OptionValueType</ReturnType>
743 An <see cref="T:Mono.Options.OptionValueType" /> instance
744 specifying whether this <see cref="T:Mono.Options.Option" /> takes
745 a value, and if so, whether it's required or optional.
748 An <see cref="T:Mono.Options.OptionValueType" /> specifying whether
749 a value is required for this value.
753 This is initialized based on the presence of <c>=</c> or
754 <c>:</c> within <see cref="P:Mono.Options.Option.Prototype" />.
759 <Member MemberName="Parse<T>">
760 <MemberSignature Language="C#" Value="protected static T Parse<T> (string value, Mono.Options.OptionContext c);" />
761 <MemberType>Method</MemberType>
763 <AssemblyVersion>0.2.0.0</AssemblyVersion>
764 <AssemblyVersion>0.2.1.0</AssemblyVersion>
767 <ReturnType>T</ReturnType>
770 <Parameter Name="value" Type="System.String" />
771 <Parameter Name="c" Type="Mono.Options.OptionContext" />
775 The type to convert the string <paramref name="value" /> to.
778 A <see cref="T:System.String" /> containing a representation of the
779 type <typeparamref name="T" /> that should be converted into an
780 instance of type <typeparamref name="T" />.
783 A <see cref="T:Mono.Options.OptionContext" /> containing additional
784 contextual information needed error handling.
787 Converts the <see cref="T:System.String" /><paramref name="value" />
788 into an object of type <typeparamref name="T" />.
791 If <paramref name="value" /> is <see langword="null" />, then
792 <see langword="default(T)" /> is returned. Otherwise,
793 <paramref name="value" /> is converted to a value of type
794 <typeparamref name="T" />.
798 <see cref="M:System.ComponentModel.TypeDescriptor.GetConverter" />
800 <see cref="T:System.ComponentModel.TypeConverter" /> associated
801 with type <typeparamref name="T" />, and
802 <see cref="M:System.ComponentModel.TypeConverter.ConvertFromString" />
803 is used to convert <paramref name="value" /> into a
804 <typeparamref name="T" />.
807 <exception cref="T:Mono.Options.OptionException">
808 If <paramref name="value" /> is not <see langword="null" /> and
809 <see cref="M:System.ComponentModel.TypeConverter.ConvertFromString" />
810 generated an exception while trying to convert
811 <paramref name="value" />.
815 <TypeParameter Name="T" />
818 <Member MemberName="Prototype">
819 <MemberSignature Language="C#" Value="public string Prototype { get; }" />
820 <MemberType>Property</MemberType>
822 <AssemblyVersion>0.2.0.0</AssemblyVersion>
823 <AssemblyVersion>0.2.1.0</AssemblyVersion>
826 <ReturnType>System.String</ReturnType>
830 The <see cref="T:Mono.Options.Option" /> prototype, containing
831 option name aliases and the option value requirements.
834 A <see cref="T:System.String" /> containing the prototype of this
835 <see cref="T:Mono.Options.Option" /> instance.
839 The prototype contains a <c>|</c>-separated list of all option name
840 aliases and a value specifier of <c>=</c> for required values and
841 <c>:</c> for optional values; if neither <c>=</c> nor <c>:</c> is
842 present, no value is taken.
845 If a value specifier is present, then a value separator list may
846 also be present after the value specifier.
851 <Member MemberName="ToString">
852 <MemberSignature Language="C#" Value="public override string ToString ();" />
853 <MemberType>Method</MemberType>
855 <AssemblyVersion>0.2.0.0</AssemblyVersion>
856 <AssemblyVersion>0.2.1.0</AssemblyVersion>
859 <ReturnType>System.String</ReturnType>
864 Returns <see cref="P:Mono.Options.Option.Prototype" />.
867 A <see cref="T:System.String" /> containing
868 <see cref="P:Mono.Options.Option.Prototype" />.