Access Enumeration by integer for example "CurveEnd Enumeration"

Hi all,

I have a simple question: I want to access the value of a enum by using an integer as for example in the curve extension method:

public Curve Extend(CurveEnd side,double length,CurveExtensionStyle style)

I want to use it like:

myCrv.Extend(CurveEnd[random.Next(3)], 3.34, CurveExtensionStyle[random.Next(4)]); 

Thanks in advance!

Direct cast from int to enum in C#:


That was really fast!
Thanks Dani!