コード例 #1
0
ファイル: MapEditor.cs プロジェクト: weimingtom/bombman
 //Save as
 private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SaveFileDialog sfd = new SaveFileDialog();
     if (sfd.ShowDialog() == DialogResult.OK)
     {
         LevelSerializor serializor = new LevelSerializor();
         serializor.Serialize(this.level, sfd.OpenFile());
         fileName = sfd.FileName;
     }
 }
コード例 #2
0
ファイル: MapEditor.cs プロジェクト: weimingtom/bombman
 //save
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (fileName == null)
     {
         saveAsToolStripMenuItem_Click(sender, e);
     }
     else
     {
         FileStream currentStream = File.Open(fileName, FileMode.Open);
         LevelSerializor serializor = new LevelSerializor();
         serializor.Serialize(this.level, currentStream);
     }
 }
コード例 #3
0
ファイル: MapEditor.cs プロジェクト: weimingtom/bombman
 //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();
 }