示例#1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saveFileDialog1 = new SaveFileDialog {
                RestoreDirectory = true,
                DefaultExt       = "xml",
                CheckPathExists  = true,
                Title            = "Save your picture",
                ValidateNames    = true
            };

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                QuadBL.SerializeList(figures, saveFileDialog1.FileName);
            }
        }
示例#2
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     openFileDialog1 = new OpenFileDialog {
         Filter           = "(*.xml)|*.xml",
         RestoreDirectory = true,
         CheckFileExists  = true,
         CheckPathExists  = true,
         Title            = "Choose file"
     };
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         figures.Clear();
         figures = QuadBL.DeserializeList(openFileDialog1.FileName);
         this.Invalidate();
     }
 }