Ejemplo n.º 1
0
        private void bt_SaveTo_Click(object sender, EventArgs e)
        {
            try
            {
                GridStorageHelper store = new GridStorageHelper();

                string to = DialogHelper.GetSavePath("Save grid...", "Grid|*.xgrid");
                store.SaveGrid(grid, to);
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("The file was not found.", "LifeGame", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
            catch (Exception x)
            {
                MessageBox.Show("An error occured : " + x.Message);
            }
        }
Ejemplo n.º 2
0
        private void LoadGrid(object to)
        {
            Grid buffer;
            GridStorageHelper store = new GridStorageHelper();

            store.BitsIterationPassed  += GridStorageHelper_BitsIterationPassed;
            store.CellsIterationPassed += GridStorageHelper_CellsIterationPassed;

            buffer = store.LoadGrid((string)to);

            if (finished)
            {
                this.Invoke(new Action(() =>
                {
                    RaiseLoadFinishedEvent(buffer);
                    this.Close();
                }
                                       ));
            }
        }
Ejemplo n.º 3
0
        private void LoadGrid(object to)
        {
            Grid buffer;
            GridStorageHelper store = new GridStorageHelper();

            store.BitsIterationPassed += GridStorageHelper_BitsIterationPassed;
            store.CellsIterationPassed += GridStorageHelper_CellsIterationPassed;

            buffer = store.LoadGrid((string)to);

            if (finished)
            {
                this.Invoke(new Action(() =>
                    {
                        RaiseLoadFinishedEvent(buffer);
                        this.Close();
                    }
                ));
            }
        }
Ejemplo n.º 4
0
        private void bt_SaveTo_Click(object sender, EventArgs e)
        {
            try
            {
                GridStorageHelper store = new GridStorageHelper();

                string to = DialogHelper.GetSavePath("Save grid...", "Grid|*.xgrid");
                store.SaveGrid(grid, to);
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("The file was not found.", "LifeGame", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            catch (Exception x)
            {
                MessageBox.Show("An error occured : " + x.Message);
            }
        }