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 ) ) ); }
string IMenuPropertyOnClickBehavior <bool> .GetInfoText(IMenuPropertyAccessor <bool> property) { return(property.GetValue().ToString()); }
void IMenuPropertyOnClickBehavior <bool> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <bool> property, string header, int spacing) { property.SetValue(!property.GetValue()); }
void IMenuPropertyOnClickBehavior <T> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <T> property, string header, int spacing) { onClick(menuUtils, property, header, spacing); }
private static void OnNormalTextColorClicked(MenuUtils menuUtils, IMenuPropertyAccessor <ConsoleColor> colorAccessor, string header, int spacing) { OnConsoleColorClicked(menuUtils, colorAccessor, header, spacing); Console.ForegroundColor = colorAccessor.GetValue(); }
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))); }
public void Init(IMenuPropertyAccessor <string> lastCreated, MenuOption lastCreatedOption) { this.lastCreated = lastCreated; this.lastCreatedOption = lastCreatedOption; }
void IMenuPropertyOnClickBehavior <T> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <T> property, string header, int spacing) { menuUtils.OpenObjectMenu(header, property.GetFieldName(), property.GetValue(), 0, spacing); }