ValidTypesAttribute Class |
Valid types to allow within a dynamic/object parameter
Inheritance Hierarchy
Namespace: Tekla.Structural.ExpressoAddIn
Assembly: Tedds.ExprInterop (in Tedds.ExprInterop.dll) Version: 26.0.0.0
Syntax
The ValidTypesAttribute type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ValidTypesAttribute |
Specify valid types to pass within parameter
|
Remarks
It is common within the .Net framework to have index properties that use different data types for keys.
For example a value in a collection can be accessed by index or name (int or string).
The ValidTypes Attribute allows a single Add-In method to accept multiple data types (by declaring the parameter as an object or dynamic type) and then inform Tedds how to pass the argument to that method.
In the name/index example, valid types of int and string would be specified in the attribute.
Tedds would then pass string variables to the method as a string but cast numeric variables from double to int before calling the method.
See Also