Table of Contents

Class VariablesCollection

Namespace
TeaPie.Variables
Assembly
TeaPie.dll
public class VariablesCollection : IEnumerable<Variable>, IEnumerable
Inheritance
VariablesCollection
Implements
Inherited Members
Extension Methods

Properties

Count

public int Count { get; }

Property Value

int

Methods

Clear()

public void Clear()

Contains(string)

public bool Contains(string variableName)

Parameters

variableName string

Returns

bool

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Variable> GetEnumerator()

Returns

IEnumerator<Variable>

An enumerator that can be used to iterate through the collection.

Get<T>(string, T?)

Attempts to get variable with given name of T type. If no such variable is found, defaultValue is retrieved.

public T? Get<T>(string name, T? defaultValue = default)

Parameters

name string

Name of the variable.

defaultValue T

Value, that will be retrieved when no variable with given name of T type was found.

Returns

T

Variable value or defaultValue if no variable with given name of T type was found.

Type Parameters

T

Type of the variable.

Remove(string)

public bool Remove(string variableName)

Parameters

variableName string

Returns

bool

RemoveVariablesWithTag(string)

Attempts to remove all variables with given tag. If removal of any of them fails, false is retrieved.

public bool RemoveVariablesWithTag(string tag)

Parameters

tag string

Tag by which variables are going to be deleted.

Returns

bool

Whether removal of all variables tagged with tag was successfull. If at least one removal failed, false is returned.

Set<T>(string, T?, params string[])

public void Set<T>(string variableName, T? value, params string[] tags)

Parameters

variableName string
value T
tags string[]

Type Parameters

T