예제 #1
0
파일: Form1.cs 프로젝트: liam93b/softwarea
        private void saveStateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BitmapState bit = new BitmapState();

            bit.setValues(xstart, xende, ystart, yende, xzoom, yzoom);

            Console.WriteLine("b4 xs : " + bit.getXS() + " xe : " + bit.getXE());

            XmlSerializer xs = new XmlSerializer(typeof(BitmapState));
            TextWriter    tw = new StreamWriter(@"c:\temp\bmpstate.xml");

            xs.Serialize(tw, bit);
            tw.Close();
        }
예제 #2
0
파일: Fractal.cs 프로젝트: jackwren/ASA
        private void saveStateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog dia = new SaveFileDialog();

            dia.Filter = "xml file (*.xml)|*.xml";

            BitmapState bit = new BitmapState();

            bit.setValues(xstart, xende, ystart, yende, xzoom, yzoom);

            if (dia.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    XmlSerializer xs = new XmlSerializer(typeof(BitmapState));
                    TextWriter    tw = new StreamWriter(dia.FileName);
                    xs.Serialize(tw, bit);
                    tw.Close();
                    MessageBox.Show("State Saved!");
                }
                catch { MessageBox.Show("There was a problem saving file."); }
            }
        }
예제 #3
0
파일: Mandelbrot.cs 프로젝트: jackwren/ASA
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //save state here
            SaveFileDialog dia = new SaveFileDialog();
            dia.Filter = "xml file (*.xml)|*.xml";

            BitmapState bit = new BitmapState();
            bit.setValues(xstart, xende, ystart, yende, xzoom, yzoom);

            if (dia.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    XmlSerializer xs = new XmlSerializer(typeof(BitmapState));
                    TextWriter tw = new StreamWriter(dia.FileName);
                    xs.Serialize(tw, bit);
                    tw.Close();
                    MessageBox.Show("State Saved!");

                }
                catch { MessageBox.Show("There was a problem saving file."); }

            }
        }