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 |
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.