private static void OnConsoleColorClicked <EnumType>(MenuUtils menuUtils, IMenuPropertyAccessor <EnumType> colorAccessor, string header, int spacing) where EnumType : struct, Enum { colorAccessor.SetValue( Enum.Parse <EnumType>( menuUtils.OpenEnumConfigEditor( header + "." + colorAccessor.GetFieldName(), colorAccessor.GetValue().ToString(), Enum.GetNames(typeof(EnumType)), spacing ) ) ); }
void IMenuPropertyOnClickBehavior <T> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <T> property, string header, int spacing) { property.SetValue(Enum.Parse <T>(menuUtils.OpenEnumConfigEditor(header + "." + property.GetFieldName(), property.GetValue().ToString(), Enum.GetNames(typeof(T)), spacing))); }