I have an enum that has 4 values:
public enum DriveRates
{
driveSidereal = 0,
driveLunar = 1,
driveSolar = 2,
driveKing = 3
}
I have an array of values that I want to cast to an array of DriveRates. However when I do var rates = (DriveRates[])ret;, with ret being an object array of numbers (probably integers), it says Unable to cast object of type 'System.Object[]' to type 'ASCOM.DeviceInterface.DriveRates[]'.
ret={0,1,2,3}. How should I do this instead. Again, I am trying to convert an array of enum values to an array of enum...well, values :) But I'm trying to convert from type object[] to type DriveRates[].