public Settings(IOstrobe io) { io.LoadData(this, "settings.txt"); if (!io.IsGood) { IsOnlyLFS = true; IsHorn = true; IsLights = true; IsOnStateOn = true; HornKey = 'B'; const int t = 200; keys = new[] { '3', '8', '3', '0', '3', '7', '3', '0' }; sleep = new[] { t, t, t, t, t, t, t, t }; } else { io.LoadData(this, "settings.txt"); } }
private void loadButton_Click(object sender, EventArgs e) { string localPath = System.IO.Directory.GetCurrentDirectory(); OpenFileDialog openFileDialog1 = new OpenFileDialog { Filter = (@"Text Files (*.txt)|*.txt"), InitialDirectory = localPath }; DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { string filePath = openFileDialog1.FileName; IOstrobe input = new IOstrobe(); input.LoadData(_settings, filePath); UpdateUI(); } }