Class CVarSet
- Namespace
- ReFuel.CVarScript
- Assembly
- ReFuel.dll
A collection of configration variables.
public class CVarSet : CVar, IConvertible, IEnumerable<CVar>, IReadOnlyDictionary<string, CVar>, IReadOnlyCollection<KeyValuePair<string, CVar>>, IEnumerable<KeyValuePair<string, CVar>>, IEnumerable
- Inheritance
-
CVarSet
- Implements
- Inherited Members
- Extension Methods
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
Globals
public static CVarSet Globals { get; }
Property Value
this[CValue?]
public override CValue? this[CValue? indexer] { get; }
Parameters
indexer
CValue
Property Value
this[string]
Gets the element that has the specified key in the read-only dictionary.
public CVar this[string key] { get; }
Parameters
key
stringThe key to locate.
Property Value
- CVar
The element that has the specified key in the read-only dictionary.
Exceptions
- ArgumentNullException
key
is null.- KeyNotFoundException
The property is retrieved and
key
is not found.
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
public IEnumerable<string> Keys { get; }
Property Value
- IEnumerable<string>
An enumerable collection that contains the keys in the read-only dictionary.
TypeName
public override string TypeName { get; }
Property Value
ValueObject
public override object? ValueObject { get; }
Property Value
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
public IEnumerable<CVar> Values { get; }
Property Value
- IEnumerable<CVar>
An enumerable collection that contains the values in the read-only dictionary.
Methods
ContainsKey(string)
Determines whether the read-only dictionary contains an element that has the specified key.
public bool ContainsKey(string key)
Parameters
key
stringThe key to locate.
Returns
- bool
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
key
is null.
Execute(CContext, ICTerminal, IEnumerable<CValue?>)
public override CValue Execute(CContext context, ICTerminal terminal, IEnumerable<CValue?> arguments)
Parameters
context
CContextterminal
ICTerminalarguments
IEnumerable<CValue>
Returns
Find(string)
public CVar? Find(string path)
Parameters
path
string
Returns
Find<T>(string)
public T? Find<T>(string path) where T : CVar
Parameters
path
string
Returns
- T
Type Parameters
T
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<CVar> GetEnumerator()
Returns
- IEnumerator<CVar>
An enumerator that can be used to iterate through the collection.
NewBindBool(string)
public CBind NewBindBool(string name)
Parameters
name
string
Returns
NewBindSigned(string)
public CBind NewBindSigned(string name)
Parameters
name
string
Returns
NewBindUnsigned(string)
public CBind NewBindUnsigned(string name)
Parameters
name
string
Returns
NewCommand(string, CCommandHandler)
public CCommand NewCommand(string name, CCommandHandler handler)
Parameters
name
stringhandler
CCommandHandler
Returns
NewHive(string)
public CVarSet NewHive(string name)
Parameters
name
string
Returns
NewLocalSet()
public static CVarSet NewLocalSet()
Returns
NewVariable<T>(string, T)
public CVar<T> NewVariable<T>(string name, T defaultValue)
Parameters
name
stringdefaultValue
T
Returns
- CVar<T>
Type Parameters
T
NewVariable<T>(string, T, CVarValidtor<T>)
public CVar<T> NewVariable<T>(string name, T defaultValue, CVarValidtor<T> validator)
Parameters
name
stringdefaultValue
Tvalidator
CVarValidtor<T>
Returns
- CVar<T>
Type Parameters
T
NewVariable<T>(string, T, T?, T?)
public CVar<T> NewVariable<T>(string name, T defaultValue, T? minValue, T? maxValue) where T : IEquatable<T>
Parameters
name
stringdefaultValue
TminValue
TmaxValue
T
Returns
- CVar<T>
Type Parameters
T
TryGetValue(string, out CVar)
Gets the value that is associated with the specified key.
public bool TryGetValue(string key, out CVar value)
Parameters
key
stringThe key to locate.
value
CVarWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
value
parameter. This parameter is passed uninitialized.
Returns
- bool
true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
key
is null.