private void btnRename_Click(object sender, EventArgs e)
        {
            var name  = cboCharacter.Text;
            var popup = new PasswordUnlocker(name);

            popup.Renamer(); //change settings for renaming
            popup.ShowDialog();
            var newName = popup.EnteredText;

            popup.Dispose();
            if (string.IsNullOrWhiteSpace(newName) || newName == name)
            {
                return;
            }
            if (newName.Length > 24)
            {
                newName = newName.Substring(0, 24).Trim();
            }
            cboCharacter.Items[cboCharacter.SelectedIndex] = newName;
            if (Tools.SaveFileCharNames.Count >= cboCharacter.SelectedIndex)
            {
                Tools.SaveFileCharNames[cboCharacter.SelectedIndex] = newName;
            }
            NeedsToSave(true);
        }
Beispiel #2
0
        private void addFolderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var sUsed = new StringCollection();

            foreach (Node node in folderTree.SelectedNode.Nodes)
            {
                sUsed.Add(node.Text);
            }
            var newName = "";

            while (string.IsNullOrWhiteSpace(newName) || sUsed.Contains(newName))
            {
                var popup = new PasswordUnlocker();
                popup.Renamer(); //change settings for renaming
                popup.ShowDialog();
                newName = popup.EnteredText;
                popup.Dispose();
                if (string.IsNullOrWhiteSpace(newName))
                {
                    return;
                }
                if (sUsed.Contains(newName))
                {
                    MessageBox.Show("That folder name is already used, try a different name", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            AddFolder(newName);
            GetSelFiles((CFolderEntry)(folderTree.FindNodeByText(Path.GetFileName(newName))).Tag);
        }