Argument

References
public abstract class Argument : IStorable
An argument (or parameter) for a FunctionUi. This is either a 2D grip, or a 1D scalar/referent.

Constructors

Argument

#
protected Argument(
reader
)

Fields

UnsetIndex

#
public const int UnsetIndex = -2147483648

Properties

Id

#
The id of this parameter. This is how the function editor UI can tell apart various parameters for various functions.
public Guid Id { get; }

Index

#
The index of this parameter. This is used by the FunctionUI to access specific parameters. It can therefore not be modified during the lifetime of the parameter.
public int Index { get; }

IsScalar

#
Gets whether this parameter is a 1D scalar.
public bool IsScalar { get; }

IsVector

#
Gets whether this parameter is a 2D vector.
public bool IsVector { get; }

Nomen

#
Description of this argument. Used to populate tooltips.
public Nomen Nomen { get; set; }

Parent

#
Grip or Scalar which serves as a parent for this argument.
public int Parent { get; }

Methods

AsScalar

#
Cast this parameter to a scalar.
public bool AsScalar(
scalar
)

AsVector

#
Cast this parameter to a vector.
public bool AsVector(
vector
)

OnArgumentChanged

#
protected void OnArgumentChanged()

Store

#
public virtual void Store(
writer
)
Store

ToFunction

#
Convert the value inside this argument to a function. This method will fail if the argument is a Vector.
public Function ToFunction()

ToScalar

#
Convert the value inside this argument to a scalar. This method will fail if the argument is a Referent, or if the argument is a Vector.
public double ToScalar()

ToVector

#
Convert the value inside this argument to a vector. This method will fail if the argument is not of type vector.
public Point2d ToVector()

Events

ArgumentChanged

#
Raised whenever one of the arguments in this collection is given a different value. Oftentimes arguments are modified in quick succession, so it's best to not take immediate action based on this event, but merely to expire caches or set dirty flags.
public event EventHandler<EventArgs> ArgumentChanged