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 <bool> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <bool> property, string header, int spacing) { property.SetValue(!property.GetValue()); }
private void OnLastCreatedClicked(MenuUtils menuUtils, string header, int spacing) { lastCreated.SetValue(menuUtils.OpenFileSelectionMenu(localSourcesConfig.GetValue().baseDirectory, lastCreated.GetValue(), spacing)); }
void IMenuPropertyOnClickBehavior <string> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <string> property, string header, int spacing) { property.SetValue(MenuUtils.OpenSimpleConfigEditor(header, property.GetFieldName(), property.GetValue())); }
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))); }