RemoveRecentWorld() public static method

public static RemoveRecentWorld ( String path ) : void
path String
return void
Ejemplo n.º 1
0
        private void menuRecentWorldItem_Click(object sender, EventArgs e)
        {
            if (!SaveIfNecessary())
            {
                return;
            }

            ToolStripMenuItem item = (ToolStripMenuItem)sender;
            String            path = Settings.RecentWorlds[int.Parse(Regex.Match(item.Text, @"^&(\d+) ").Groups[1].Value) - 1].Path;

            if (File.Exists(path))
            {
                OpenWorld(path);
            }
            else
            {
                DialogResult res = MessageBox.Show(this, String.Format("Unable to open \"{0}\", file not found. Would you like to remove it from the recent worlds list?", path), "Open", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2);
                if (res == DialogResult.Yes)
                {
                    Settings.RemoveRecentWorld(path);
                    FillRecentWorldsList();
                }
            }
        }