Beispiel #1
0
        private void Menu_File_Export_Click(object sender, EventArgs e)
        {
            var dialog = new SaveFileDialog();

            dialog.Title    = Properties.SystemMessage.SaveTJA;
            dialog.FileName = Program.Project.ProjectName + Properties.Common.TJAExtensionName;
            dialog.Filter   = string.Format("{0}|*{1}", Properties.Common.TJAExtensionDescription, Properties.Common.TJAExtensionName);
            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                TJAManager.Build(dialog.FileName, Program.Project, Program.Setting.UTF8Mode ? Encoding.UTF8 : Encoding.GetEncoding("Shift_JIS"));
                foreach (var item in Program.Project.ProjectFile)
                {
                    var fileName = Path.GetDirectoryName(dialog.FileName) + "\\" + Path.GetFileName(item);
                    try
                    {
                        File.Copy(item, fileName, true);
                    }
                    catch (Exception)
                    {
                    }
                }

                // フォルダを開く
                if (Program.Setting.Open_Extract_Folder)
                {
                    var dir = Path.GetDirectoryName(dialog.FileName);
                    System.Diagnostics.Process.Start(dir);
                }
            }
        }
Beispiel #2
0
        public void MakePreview(Course course, bool isCalledTextEditor = false)
        {
            if (isCalledTextEditor && !Menu_Execution_LiveUpdate.Checked)
            {
                return;
            }
            var tempDir = Program.EXEPath + @"\temp\";

            if (!Directory.Exists(tempDir))
            {
                Directory.CreateDirectory(tempDir);
            }
            TJAManager.Build(tempDir + Program.Project.ProjectName + ".tja", Program.Project.CommonHeader, new Course[] { course }, Program.Setting.UTF8Mode ? Encoding.UTF8 : Encoding.GetEncoding("Shift_JIS"));
            foreach (var item in Program.Project.ProjectFile)
            {
                var fileName = tempDir + Path.GetFileName(item);
                try
                {
                    File.Copy(item, fileName, true);
                }
                catch (Exception)
                {
                }
            }
        }