Example #1
0
        public void onLoad(object obj, EventArgs e)
        {
            string filePath = string.Empty;

            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = "c:\\";
            openFileDialog.Filter           = "CRAZY files (*.crazy)|*.crazy";
            openFileDialog.RestoreDirectory = true;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                //Get the path of specified file
                filePath = openFileDialog.FileName;

                model.loadFromFile(filePath);
                boardGrid.Visible = true;

                pause.Enabled = false;
                play.Enabled  = true;
                save.Enabled  = false;
                load.Enabled  = false;

                statusBar.Text = "Game has loaded. Press play to continue";
            }
        }