Click or drag to resize

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:  Frontenac.Blueprints.Util
Assembly:  VelocityGraph (in VelocityGraph.dll) Version: 10.1.0.0 (10.1)
Syntax
public static void TypecastProperty(
	this IEnumerable<IElement> elements,
	string key,
	Type classCast
)

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