This repository was archived by the owner on Jan 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.cs
More file actions
122 lines (93 loc) · 3.75 KB
/
Copy pathMainWindow.cs
File metadata and controls
122 lines (93 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using System;
using System.IO;
using System.Windows.Forms;
using WodiKs.IO;
namespace WolfEventCodeCreater
{
public partial class MainWindow : Form
{
private Model.UserSetting userSetting;
private Model.Config Config;
public MainWindow()
{
InitializeComponent();
userSetting = Utils.File.LoadUserSetting();
Config = new Model.Config(userSetting);
textBox1.Text = Config.ProjectRoot;
if(0 < AppMesOpp.AppMesCount)
{
AppMesOpp.AddEnclosedSeparatorAppMessge();
textBox2.Text = AppMesOpp.ReturnAppMessge() + textBox2.Text;
}
}
private void selectProject(object sender, EventArgs e)
{
AppMesOpp.ClearAppMessge();
var fbd = new FolderBrowserDialog();
fbd.Description = "プロジェクトのルートディレクトリを選択してください。";
fbd.ShowNewFolderButton = false;
if (fbd.ShowDialog(this) == DialogResult.OK)
{
textBox1.Text = fbd.SelectedPath;
if (!button2.Enabled)
{
AppMesOpp.AddEnclosedSeparatorAppMessge();
textBox2.Text = AppMesOpp.ReturnAppMessge() + textBox2.Text;
}
}
}
private void create(object sender, EventArgs e)
{
AppMesOpp.ClearAppMessge();
string now = DateTime.Now.ToString("yyyyMMdd_HHmmss");
string headMessage = ($"------出力実行({ now })------");
AppMesOpp.AddAppMessge(headMessage, false, false);
System.Diagnostics.Debug.WriteLine(headMessage);
try
{
// settings.xmlの上書き
Config = userSetting.OverWriteUserSettingFile(Config.ProjectRoot, now);
// ウディタ情報を取得
var outputDriver = new Model.OutputDriver(Config);
// ファイル出力処理
outputDriver.Output();
System.Diagnostics.Debug.WriteLine($"------出力処理正常終了------");
}
catch(Exception err)
{
AppMesOpp.AddAppMessge(err.ToString(), true, false);
System.Diagnostics.Debug.WriteLine($"------出力処理異常終了------");
}
// settings.xmlを出力先ディレクトリに出力
Utils.File.WriteUserSetting(userSetting, Config.DumpDirPath, $"_{ now }");
// メッセージの表示
AppMesOpp.AddSeparatorAppMessge();
textBox2.Text = AppMesOpp.ReturnAppMessge(true) + textBox2.Text;
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show(
$"Version { Application.ProductVersion }",
"バージョン情報",
MessageBoxButtons.OK,
MessageBoxIcon.None
);
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void setting(object sender, EventArgs e)
{
var settingWindow = new SettingWindow(userSetting);
settingWindow.ShowDialog(this);
settingWindow.Dispose();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
AppMesOpp.ClearAppMessge();
Config.ProjectRoot = textBox1.Text;
button2.Enabled = Config.IsWoditerDefineFiles();
}
}
}