public static void Dialog_Enum <T>(this Listing_Standard list, string desc, ref T forEnum, bool addGapAfter = true, bool addGapBefore = true) { list.Dialog_Label(desc, addGapBefore); var type = forEnum.GetType(); var choices = Enum.GetValues(type); foreach (var choice in choices) { var label = type.Name + "_" + choice.ToString(); if (list.Dialog_RadioButton(forEnum.Equals(choice), label)) { forEnum = (T)choice; } } if (addGapAfter) { list.Gap(8f); } }