Class OptionSet
Inheritance
System.Object
System.Collections.ObjectModel.Collection<
Option>
System.Collections.ObjectModel.KeyedCollection<
System.String,
Option>
OptionSet
Syntax
public class OptionSet : KeyedCollection<string, Option>, IList<Option>, ICollection<Option>, IList, ICollection, IReadOnlyList<Option>, IReadOnlyCollection<Option>, IEnumerable<Option>, IEnumerable
Constructors
OptionSet()
Declaration
OptionSet(Converter<String, String>)
Declaration
public OptionSet(Converter<string, string> localizer)
Parameters
| Type |
Name |
Description |
| System.Converter<System.String, System.String> |
localizer |
|
Properties
MessageLocalizer
Declaration
public Converter<string, string> MessageLocalizer { get; }
Property Value
| Type |
Description |
| System.Converter<System.String, System.String> |
|
Methods
Add(Option)
Declaration
public OptionSet Add(Option option)
Parameters
| Type |
Name |
Description |
| Option |
option |
|
Returns
Add(String, OptionAction<String, String>)
Declaration
public OptionSet Add(string prototype, OptionAction<string, string> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| OptionAction<System.String, System.String> |
action |
|
Returns
Add(String, Action<String>)
Declaration
public OptionSet Add(string prototype, Action<string> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.Action<System.String> |
action |
|
Returns
Add(String, String, OptionAction<String, String>)
Declaration
public OptionSet Add(string prototype, string description, OptionAction<string, string> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.String |
description |
|
| OptionAction<System.String, System.String> |
action |
|
Returns
Add(String, String, Action<String>)
Declaration
public OptionSet Add(string prototype, string description, Action<string> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.String |
description |
|
| System.Action<System.String> |
action |
|
Returns
Add<T>(String, Action<T>)
Declaration
public OptionSet Add<T>(string prototype, Action<T> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.Action<T> |
action |
|
Returns
Type Parameters
Add<T>(String, String, Action<T>)
Declaration
public OptionSet Add<T>(string prototype, string description, Action<T> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.String |
description |
|
| System.Action<T> |
action |
|
Returns
Type Parameters
Add<TKey, TValue>(String, OptionAction<TKey, TValue>)
Declaration
public OptionSet Add<TKey, TValue>(string prototype, OptionAction<TKey, TValue> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| OptionAction<TKey, TValue> |
action |
|
Returns
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
Add<TKey, TValue>(String, String, OptionAction<TKey, TValue>)
Declaration
public OptionSet Add<TKey, TValue>(string prototype, string description, OptionAction<TKey, TValue> action)
Parameters
| Type |
Name |
Description |
| System.String |
prototype |
|
| System.String |
description |
|
| OptionAction<TKey, TValue> |
action |
|
Returns
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
CreateOptionContext()
Declaration
protected virtual OptionContext CreateOptionContext()
Returns
GetKeyForItem(Option)
Declaration
protected override string GetKeyForItem(Option item)
Parameters
| Type |
Name |
Description |
| Option |
item |
|
Returns
| Type |
Description |
| System.String |
|
Overrides
System.Collections.ObjectModel.KeyedCollection<System.String, NDesk.Options.Option>.GetKeyForItem(NDesk.Options.Option)
GetOptionForName(String)
Declaration
[Obsolete("Use KeyedCollection.this[string]")]
protected Option GetOptionForName(string option)
Parameters
| Type |
Name |
Description |
| System.String |
option |
|
Returns
GetOptionParts(String, out String, out String, out String, out String)
Declaration
protected bool GetOptionParts(string argument, out string flag, out string name, out string sep, out string value)
Parameters
| Type |
Name |
Description |
| System.String |
argument |
|
| System.String |
flag |
|
| System.String |
name |
|
| System.String |
sep |
|
| System.String |
value |
|
Returns
| Type |
Description |
| System.Boolean |
|
InsertItem(Int32, Option)
Declaration
protected override void InsertItem(int index, Option item)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| Option |
item |
|
Overrides
System.Collections.ObjectModel.KeyedCollection<System.String, NDesk.Options.Option>.InsertItem(System.Int32, NDesk.Options.Option)
Parse(IEnumerable<String>)
Declaration
public List<string> Parse(IEnumerable<string> arguments)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<System.String> |
arguments |
|
Returns
| Type |
Description |
| System.Collections.Generic.List<System.String> |
|
Parse(String, OptionContext)
Declaration
protected virtual bool Parse(string argument, OptionContext c)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
RemoveItem(Int32)
Declaration
protected override void RemoveItem(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Overrides
System.Collections.ObjectModel.KeyedCollection<System.String, NDesk.Options.Option>.RemoveItem(System.Int32)
SetItem(Int32, Option)
Declaration
protected override void SetItem(int index, Option item)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| Option |
item |
|
Overrides
System.Collections.ObjectModel.KeyedCollection<System.String, NDesk.Options.Option>.SetItem(System.Int32, NDesk.Options.Option)
WriteOptionDescriptions(TextWriter)
Declaration
public void WriteOptionDescriptions(TextWriter o)
Parameters
| Type |
Name |
Description |
| System.IO.TextWriter |
o |
|