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();
 }
Exemplo n.º 6
0
 void IMenuPropertyOnClickBehavior <string> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <string> property, string header, int spacing)
 {
     property.SetValue(MenuUtils.OpenSimpleConfigEditor(header, property.GetFieldName(), property.GetValue()));
 }
Exemplo n.º 7
0
 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)));
 }
Exemplo n.º 8
0
 public void Init(IMenuPropertyAccessor <string> lastCreated, MenuOption lastCreatedOption)
 {
     this.lastCreated       = lastCreated;
     this.lastCreatedOption = lastCreatedOption;
 }
Exemplo n.º 9
0
 void IMenuPropertyOnClickBehavior <T> .OnClick(MenuUtils menuUtils, IMenuPropertyAccessor <T> property, string header, int spacing)
 {
     menuUtils.OpenObjectMenu(header, property.GetFieldName(), property.GetValue(), 0, spacing);
 }