public int this[string key, bool returnInt = true] { get { var menu = ParseMenuNames.GetMenu(key); if (menu?[key] != null) { var type = menu[key].GetType(); switch (type.ToString()) { case "EloBuddy.SDK.Menu.Values.ComboBox": return(menu[key].Cast <ComboBox>().CurrentValue); case "EloBuddy.SDK.Menu.Values.Slider": return(menu[key].Cast <Slider>().CurrentValue); default: Misc.PrintDebugMessage("Menu item : " + key + " is not oftype int."); break; } } Misc.PrintDebugMessage("Menu item : " + key + " doesn't exists."); return(0); } set { var menu = ParseMenuNames.GetMenu(key); if (menu?[key] != null) { var type = menu[key].GetType(); switch (type.ToString()) { case "EloBuddy.SDK.Menu.Values.ComboBox": menu[key].Cast <ComboBox>().CurrentValue = value; break; case "EloBuddy.SDK.Menu.Values.Slider": menu[key].Cast <Slider>().CurrentValue = value; break; default: Misc.PrintDebugMessage("Menu item : " + key + " is not oftype int."); break; } } else { Misc.PrintDebugMessage("Menu item : " + key + " doesn't exists."); } } }
public bool this[string key] { get { var menu = ParseMenuNames.GetMenu(key); if (menu?[key] != null) { var type = menu[key].GetType(); switch (type.ToString()) { case "EloBuddy.SDK.Menu.Values.CheckBox": return(menu[key].Cast <CheckBox>().CurrentValue); case "EloBuddy.SDK.Menu.Values.KeyBind": return(menu[key].Cast <KeyBind>().CurrentValue); default: Misc.PrintDebugMessage("Menu item : " + key + " is not oftype bool."); break; } } Misc.PrintDebugMessage("Menu item : " + key + " doesn't exists."); return(false); } set { var menu = ParseMenuNames.GetMenu(key); if (menu?[key] != null) { var type = menu[key].GetType(); switch (type.ToString()) { case "EloBuddy.SDK.Menu.Values.CheckBox": menu[key].Cast <CheckBox>().CurrentValue = value; break; case "EloBuddy.SDK.Menu.Values.KeyBind": menu[key].Cast <KeyBind>().CurrentValue = value; break; default: Misc.PrintDebugMessage("Menu item : " + key + " is not oftype bool."); break; } } Misc.PrintDebugMessage("Menu item : " + key + " doesn't exists."); } }