Exemple #1
0
        private void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var item = listView1.FocusedItem;

            var renamer = new RenameForm();

            renamer.setText(item.SubItems[0].Text);
            var result = renamer.ShowDialog();

            if (result == DialogResult.OK)
            {
                for (var i = 0; i < this.games.Count; i++)
                {
                    if (this.games[i].Name.Equals(item.SubItems[0].Text))
                    {
                        this.games[i].Name = renamer.getText();
                        SaveGames(this.games);
                        LoadGamesList(listView1); //refresh list
                        return;
                    }
                }
                log.Error("Rename: Could not find game to rename");
                MessageBox.Show("Could not find the game to rename", "Missing Game", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Exemple #2
0
        private void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var item    = listView1.FocusedItem;
            var renamer = new RenameForm();

            renamer.setText(item.SubItems[0].Text);
            var result = renamer.ShowDialog();


            for (var i = 0; i < this.profiles.Count; i++)
            {
                if (this.profiles[i].name.Equals(item.SubItems[0].Text))
                {
                    this.profiles[i].name = renamer.getText();
                    SaveProfiles(this.profiles);
                    LoadGroupsToList();
                    return;
                }
            }
            log.Error("RenameProfile: Could not find profile to rename");
            MessageBox.Show("Could not find a profile to rename", "Missing Profile", MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
        }