Exemplo n.º 1
0
        /// <summary>
        /// load a game
        /// </summary>
        /// <returns>true if the game has been load else false</returns>
        public bool load_Game()
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.Filter           = "Save file (.save) | *.save";
            dlg.DefaultExt       = "save";
            dlg.InitialDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
            Nullable <bool> result = dlg.ShowDialog();

            if (result == true)
            {
                // Open document
                string filename = dlg.FileName;
                game.LoadBoard(filename);
                refreshGrid();
                return(true);
            }
            return(false);
        }