Ejemplo n.º 1
0
        private void importarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Levels tmpLevels = Levels.Load(ofd.FileName);

                    foreach (Level tmpLevel in tmpLevels)
                    {
                        levels.Add(tmpLevel);
                    }

                    initializeView();
                    this.levelSelector.RedrawAll();
                }
                catch (Exception exc)
                {
                    MessageBox.Show(string.Format("Error:\n{0}", exc.ToString()), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
        private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    levels = Levels.Load(ofd.FileName);
                    this.levelSelector.Levels = levels;

                    if (levels.Count > 0)
                    {
                        currentLevel = levels[0];
                    }

                    initializeView();
                }
                catch (Exception exc)
                {
                    MessageBox.Show(string.Format("Error:\n{0}", exc.ToString()), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }