BiomePainter.Settings.RemoveRecentWorld C# (CSharp) 메소드

RemoveRecentWorld() 공개 정적인 메소드

public static RemoveRecentWorld ( String path ) : void
path String
리턴 void
        public static void RemoveRecentWorld(String path)
        {
            for (int i = recentWorlds.Count - 1; i >= 0; i--)
            {
                if (recentWorlds[i].Path == path)
                    recentWorlds.RemoveAt(i);
            }
        }

Usage Example

예제 #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();
                }
            }
        }