Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var dict = new Dictionary <string, string>();

            for (int i = 0; i < listView1.Items.Count; i++)
            {
                var item = listView1.Items[i];
                dict.Add(item.Text, item.SubItems[1].Text);
            }

            GameOptionsFile.WriteFile(Path, dict);
        }
Beispiel #2
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            this.Path = txtPath.Text;

            optionFile = GameOptionsFile.ReadFile(this.Path);
            foreach (var item in optionFile)
            {
                listView1.Items.Add(new ListViewItem(new []
                {
                    item.Key,
                    item.Value
                }));
            }
        }