private void OptionsWindow_Load(object sender, EventArgs e) { options = Options.Load(); checkBox1.Checked = options.ShowLicense; textBox1.Text = options.StartKey.ToString(); textBox2.Text = options.StopKey.ToString(); }
public static Options Load() { if (File.Exists("Options.xml")) { XmlSerializer ser = new XmlSerializer(typeof(Options)); Stream s = File.Open("Options.xml", FileMode.Open); Options deserialized = (Options)ser.Deserialize(s); s.Close(); s.Dispose(); return deserialized; } else { Options o = new Options(); o.Save(); return o; } }
private void Form1_Load(object sender, EventArgs e) { //RustLauncher2.Properties.Resources.Version options = Options.Load(); new License().ShowDialog(); DownL("http://bit.ly/RustLauncher2Version", "LauncherVersion.txt"); Servers = Servers.Load(); string[] dirs = Directory.GetDirectories(Environment.CurrentDirectory); RustDirs = new List<string>(); foreach (string dir in dirs) { if (File.Exists(Path.Combine(dir, "Rust.exe")) && File.Exists(Path.Combine(dir, "RustClient.exe"))) { RustDirs.Add(dir); } } Identifiers = new List<string[]>(); foreach (string dir in RustDirs) { Identifiers.Add(MakeIdentifier(dir)); } foreach (Servers.Server s in Servers.ServerList) { RefreshServer(s); listBox1.Items.Add(s); listBox1.Refresh(); } }
private void button1_Click(object sender, EventArgs e) { new OptionsWindow().ShowDialog(); options = Options.Load(); }