ElementHelpersTypecastProperty Method |
Typecasts a property value. This only works for casting to a class that has a constructor of the for new X(string).
If no such constructor exists, an Exception is thrown and the original element property is left unchanged.
Namespace:
VelocityGraph.Frontenac.Blueprints.Util
Assembly:
VelocityGraph (in VelocityGraph.dll) Version: 11.1.0.0 (11.1)
Syntax public static void TypecastProperty(
this IEnumerable<IElement> elements,
string key,
Type classCast
)
<ExtensionAttribute>
Public Shared Sub TypecastProperty (
elements As IEnumerable(Of IElement),
key As String,
classCast As Type
)
public:
[ExtensionAttribute]
static void TypecastProperty(
IEnumerable<IElement^>^ elements,
String^ key,
Type^ classCast
)
[<ExtensionAttribute>]
static member TypecastProperty :
elements : IEnumerable<IElement> *
key : string *
classCast : Type -> unit
Parameters
- elements
- Type: System.Collections.GenericIEnumerableIElement
the elements to have their property typecasted - key
- Type: SystemString
the key for the property value to typecast - classCast
- Type: SystemType
the class to typecast to
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableIElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also