public void SaveState()
        {
            var list = new List<MBall>();
            foreach (var item in bouncingBalls)
            {
                list.Add(new MBall() { dx = item.dx, dy = item.dy, radius = item.radius, x = item.X, y = item.Y });
            }

            mem = new Memento(list);
        }
        private void OpenButton_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "XML files | *.xml | JSON files | *.json | CSV files | *.csv | YAML files | *.yaml ";
            if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
            string ext = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf('.') + 1);

            Creator cr = new Creator();
            cr.Format(ext.ToUpper());
             mem = new Memento(cr.From(openFileDialog1.FileName);
            LoadState();
            timer1.Start();
        }