Class ExpressionParameters
- Namespace
- xFunc.Maths.Expressions.Parameters
- Assembly
- xFunc.Maths.dll
Strongly typed collection that contains parameters.
public class ExpressionParameters : IEnumerable<Parameter>, IEnumerable, INotifyCollectionChanged
- Inheritance
-
ExpressionParameters
- Implements
- Inherited Members
Constructors
ExpressionParameters()
Initializes a new instance of the ExpressionParameters class.
public ExpressionParameters()
ExpressionParameters(bool)
Initializes a new instance of the ExpressionParameters class.
public ExpressionParameters(bool initConstants)
Parameters
initConstantsboolif set to
trueinitialize constants.
ExpressionParameters(IEnumerable<Parameter>)
Initializes a new instance of the ExpressionParameters class.
public ExpressionParameters(IEnumerable<Parameter> parameters)
Parameters
parametersIEnumerable<Parameter>The parameters.
ExpressionParameters(IEnumerable<Parameter>?, bool)
Initializes a new instance of the ExpressionParameters class.
public ExpressionParameters(IEnumerable<Parameter>? parameters, bool initConstants)
Parameters
parametersIEnumerable<Parameter>The parameters.
initConstantsboolif set to
trueinitialize constants.
Exceptions
- ArgumentNullException
parametersisnull.
ExpressionParameters(ExpressionParameters)
Initializes a new instance of the ExpressionParameters class.
public ExpressionParameters(ExpressionParameters parameters)
Parameters
parametersExpressionParametersThe parameters.
Properties
this[string]
Gets or sets the value of variable.
public virtual ParameterValue this[string key] { get; set; }
Parameters
keystringThe name of variable.
Property Value
- ParameterValue
The value of parameter.
Methods
Add(string, ParameterValue)
Adds the specified element to a set.
public void Add(string key, ParameterValue value)
Parameters
keystringThe name of variable.
valueParameterValueThe value of variable.
Add(Parameter)
Adds the specified element to a set.
public void Add(Parameter param)
Parameters
paramParameterThe element.
Exceptions
- ArgumentNullException
paramis null.- ParameterIsReadOnlyException
The variable is read only.
Clear()
Clears this collection.
public void Clear()
Contains(Parameter)
Determines whether an object contains the specified element.
public virtual bool Contains(Parameter param)
Parameters
paramParameterThe element.
Returns
- bool
trueif the object contains the specified element; otherwise,false.
ContainsKey(string)
Determines whether an object contains the specified key.
public virtual bool ContainsKey(string key)
Parameters
keystringThe name of variable.
Returns
- bool
trueif the object contains the specified key; otherwise,false.
CreateScoped(ExpressionParameters?)
Creates a new nested scope of parameters.
public static ExpressionParameters CreateScoped(ExpressionParameters? parameters)
Parameters
parametersExpressionParametersThe instance of the base parameters collection.
Returns
- ExpressionParameters
The expression parameters.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public virtual IEnumerator<Parameter> GetEnumerator()
Returns
- IEnumerator<Parameter>
An enumerator that can be used to iterate through the collection.
OnCollectionChanged(NotifyCollectionChangedEventArgs)
Raises the CollectionChanged event.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
Parameters
argsNotifyCollectionChangedEventArgsThe NotifyCollectionChangedEventArgs instance containing the event data.
Remove(string)
Removes the specified element from this object.
public void Remove(string key)
Parameters
keystringThe name of variable.
Exceptions
- ArgumentNullException
keyis null.- ParameterIsReadOnlyException
The variable is read only.
Remove(Parameter)
Removes the specified element from this object.
public bool Remove(Parameter param)
Parameters
paramParameterThe element.
Returns
- bool
trueif item was successfully removed from the collection; otherwise,false.
Exceptions
- ArgumentNullException
paramis null.- ParameterIsReadOnlyException
The variable is read only.
TryGetParameter(string, out Parameter?)
Gets the value of parameter.
public virtual bool TryGetParameter(string key, out Parameter? parameter)
Parameters
Returns
- bool
trueif the current collection contains specified parameter, otherwisefalse.
Events
CollectionChanged
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler? CollectionChanged