public BotOptionsForm(BotOptionsModel model) { _model = model; InitializeComponent(); LoadData(model); }
public void LoadData(BotOptionsModel model) { tbEnterMin.Text = model.EnterMin.ToString(); tbEnterMax.Text = model.EnterMax.ToString(); tbExitMin.Text = model.ExitMin.ToString(); tbExitMax.Text = model.ExitMax.ToString(); tbReconnectMin.Text = model.ReconnectMin.ToString(); tbReconnectMax.Text = model.ReconnectMax.ToString(); }
private void btnBotOptions_Click(object sender, EventArgs e) { var model = new BotOptionsModel() { EnterMin = DataManager.Data.BotOptions.EnterMin, EnterMax = DataManager.Data.BotOptions.EnterMax, ExitMin = DataManager.Data.BotOptions.ExitMin, ExitMax = DataManager.Data.BotOptions.ExitMax, ReconnectMin = DataManager.Data.BotOptions.ReconnectMin, ReconnectMax = DataManager.Data.BotOptions.ReconnectMax, }; if (BotOptionsModel.TryGetModel(model)) { DataManager.Data.BotOptions.EnterMin = model.EnterMin; DataManager.Data.BotOptions.EnterMax = model.EnterMax; DataManager.Data.BotOptions.ExitMin = model.ExitMin; DataManager.Data.BotOptions.ExitMax = model.ExitMax; DataManager.Data.BotOptions.ReconnectMin = model.ReconnectMin; DataManager.Data.BotOptions.ReconnectMax = model.ReconnectMax; DataManager.Save(); } }