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:
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_Extend_2.htm

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#:
(EnumType)intValue;

(CurveEnd)random.Next(3),
(CurveExtensionStyle)random.Next(4)

That was really fast!
Thanks Dani!