Beispiel #1
0
 // New
 private void kjkkToolStripMenuItem_Click(object sender, EventArgs e)
 {
     init();
     level = new Level();
     fileName = null;
     paintBoard.Visible = true;
     paintBoard.Invalidate();
 }
Beispiel #2
0
 //open
 private void kkkToolStripMenuItem_Click(object sender, EventArgs e)
 {
     OpenFileDialog ofd = new OpenFileDialog();
     if (ofd.ShowDialog() == DialogResult.OK)
     {
         LevelSerializor serializor = new LevelSerializor();
         this.level = serializor.DeSerialize(ofd.OpenFile());
     }
     init();
     fileName = ofd.FileName;
     paintBoard.Visible = true;
     paintBoard.Invalidate();
 }
 public void Serialize(Level level, Stream stream)
 {
     XmlSerializer formatter = new XmlSerializer(typeof(Level));
     formatter.Serialize(stream, level);
     stream.Close();
 }