示例#1
0
        private void saveClick(object sender, EventArgs e)
        {
            if (projectPath == null)
            {
                saveFile.Filter     = "Dyzen Project File (*.dyz)|*.dyz";
                saveFile.DefaultExt = "dyz";
                if (projectPath != null)
                {
                    saveFile.FileName = Path.GetFileNameWithoutExtension(projectPath);
                }
                if (saveFile.ShowDialog() == DialogResult.OK)
                {
                    projectPath = saveFile.FileName;
                }
                else
                {
                    return;
                }
            }
            if (Path.GetFileNameWithoutExtension(projectPath) == "")
            {
                return;
            }
            if (File.Exists(projectPath))
            {
                File.Delete(projectPath);
            }
            ProjectContainer pc = new ProjectContainer();

            pc.GetAttributes(frameCreator1.Frames, animationCreator1.Animations,
                             codeEditorController1.CodeEditor.Text, spriteGFXBox1.GetGFX(), spriteGFXBox2.GetGFX());
            pc.Serialize(projectPath);
            MessageBox.Show("Project " + Path.GetFileNameWithoutExtension(projectPath) + " Saved.",
                            "Save Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }