diff --git a/GetADoc/MainWindow.xaml b/GetADoc/MainWindow.xaml
index d92f60d238d8e99841a68c6b658c50ea4b370ea8..00586e1adf8e4ea31753e24efddb17a33ef62705 100644
--- a/GetADoc/MainWindow.xaml
+++ b/GetADoc/MainWindow.xaml
@@ -23,17 +23,17 @@
AsciiDocの雛形を作成します
-
+
<フォルダ指定>
-
+
-
-
-
+
+
+
diff --git a/GetADoc/MainWindow.xaml.cs b/GetADoc/MainWindow.xaml.cs
index 52fc1704bd1057c92290a6429f765c8bd42da7eb..27b8f1f3a04be65dbfea3e357be7682b47a1b2a1 100644
--- a/GetADoc/MainWindow.xaml.cs
+++ b/GetADoc/MainWindow.xaml.cs
@@ -30,16 +30,16 @@ namespace GetADoc
InitializeComponent();
//デフォルトに前回の設定を表示
- box1.Text = Properties.Settings.Default.box1Setting;
- checkbox1.IsChecked = Properties.Settings.Default.checkbox1Setting;
- checkbox2.IsChecked = Properties.Settings.Default.checkbox2Setting;
- checkbox3.IsChecked = Properties.Settings.Default.checkbox3Setting;
+ FolderPathBox.Text = Properties.Settings.Default.box1Setting;
+ ScreenCheckbox.IsChecked = Properties.Settings.Default.checkbox1Setting;
+ IconCheckbox.IsChecked = Properties.Settings.Default.checkbox2Setting;
+ SepaDocCheckbox.IsChecked = Properties.Settings.Default.checkbox3Setting;
//ドラッグ&ドロップイベントの追加
allBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
allBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
- box1.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
- box1.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
+ FolderPathBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
+ FolderPathBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
}
//フォルダ指定のためにファイルをドラッグ
@@ -68,9 +68,9 @@ namespace GetADoc
dropFiles[0] = dropFiles[0].Substring(0, dropFiles[0].LastIndexOf(@"\"));
}
- box1.Text = dropFiles[0];
- box1.Focus();
- box1.Select(this.box1.Text.Length, 0);
+ FolderPathBox.Text = dropFiles[0];
+ FolderPathBox.Focus();
+ FolderPathBox.Select(this.FolderPathBox.Text.Length, 0);
}
//参照ボタンClickでフォルダ選択のダイアログを表示
@@ -84,7 +84,7 @@ namespace GetADoc
{
return;
}
- box1.Text = selectFile.FileName;
+ FolderPathBox.Text = selectFile.FileName;
}
//作成ボタンClickでチェックボックスで要求された仕様のADocファイル一式を指定先フォルダに生成
@@ -94,21 +94,21 @@ namespace GetADoc
bool IconFlag = false;
bool SCREENFlag = false;
bool SepaFlag = false;
- if (checkbox2.IsChecked == true)//Iconsチェックボックスがオンのとき
+ if (IconCheckbox.IsChecked == true)//Iconsチェックボックスがオンのとき
{
IconFlag = true;
}
- if (checkbox1.IsChecked == true)//SCREEN Logoチェックボックスがオンのとき
+ if (ScreenCheckbox.IsChecked == true)//SCREEN Logoチェックボックスがオンのとき
{
SCREENFlag = true;
}
- if (checkbox3.IsChecked == true)//分割ドキュチェックボックスがオンのとき
+ if (SepaDocCheckbox.IsChecked == true)//分割ドキュチェックボックスがオンのとき
{
SepaFlag = true;
}
//ファイルパスが指定されていない or 指定したフォルダが存在しない場合
- if (box1.Text == "" || !Directory.Exists(box1.Text))
+ if (FolderPathBox.Text == "" || !Directory.Exists(FolderPathBox.Text))
{
CustomMsgBox.Show(mainWindow, "保存先が存在しません", "Save destination does not exist", MessageBoxButton.OK, MessageBoxImage.Warning);
Properties.Settings.Default.box1Setting = ""; //記憶していたパスを初期化
@@ -117,13 +117,13 @@ namespace GetADoc
}
// テキストボックス2からfile名を取得
- var fileName = box2.Text;
- if (box2.Text == "")
+ var fileName = ADocNameBox.Text;
+ if (ADocNameBox.Text == "")
{
fileName = "t";
}
//テキストボック1から保存場所を取得
- var filePath = box1.Text + @"\";
+ var filePath = FolderPathBox.Text + @"\";
// ファイル名に使用不可の文字が含まれている場合の処理
char[] NgChars = System.IO.Path.GetInvalidFileNameChars();
@@ -133,7 +133,7 @@ namespace GetADoc
fileName = RunBatch.NameCalibration(fileName);
CustomMsgBox.Show(mainWindow, "ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。" +
"\nもう一度作成ボタンをクリックしてください。", "Renamed this file", MessageBoxButton.OK, MessageBoxImage.Warning);
- box2.Text = fileName;
+ ADocNameBox.Text = fileName;
return;
}
@@ -165,10 +165,10 @@ namespace GetADoc
CompletedLabel.Visibility = Visibility.Visible;
//指定されたファイルパスとチェックボックスを保存
- Properties.Settings.Default.box1Setting = box1.Text;
- Properties.Settings.Default.checkbox1Setting = ((bool)checkbox1.IsChecked);
- Properties.Settings.Default.checkbox2Setting = ((bool)checkbox2.IsChecked);
- Properties.Settings.Default.checkbox3Setting = ((bool)checkbox3.IsChecked);
+ Properties.Settings.Default.box1Setting = FolderPathBox.Text;
+ Properties.Settings.Default.checkbox1Setting = ((bool)ScreenCheckbox.IsChecked);
+ Properties.Settings.Default.checkbox2Setting = ((bool)IconCheckbox.IsChecked);
+ Properties.Settings.Default.checkbox3Setting = ((bool)SepaDocCheckbox.IsChecked);
Properties.Settings.Default.Save();
}
diff --git a/GetADoc/RunBatch.cs b/GetADoc/RunBatch.cs
index 3ad9755a18be61498e622e26e5a22b856c129546..4d63ccf186562937297a2f9922752724e76e9433 100644
--- a/GetADoc/RunBatch.cs
+++ b/GetADoc/RunBatch.cs
@@ -85,44 +85,17 @@ namespace GetADoc
process.Close();
//指定されたフォルダに生成物を移動
- RunBatch.MoveProduct(icon, sepa, fileName, tempPath, filePath);
+ RunBatch.MoveDirectory(tempPath, filePath);
//テンポラリフォルダの消去
TemporaryFolder.DeleteTempFolder(tempPath);
}
- //生成物を指定先フォルダへ移動
- static public void MoveProduct(bool icon, bool sepa,
- string fileName, string tempPath, string filePath)
- {
- /*
- 個別移動ではなく、フォルダ全体を移動した方がよいが、とりあえずそのまま。理由:内部コマンドで生成物が増えたらまた追加修正が必要である。
- */
- File.Move(System.IO.Path.Combine(tempPath, fileName + ".adoc"), filePath + fileName + ".adoc");
- File.Move(System.IO.Path.Combine(tempPath, "config.adoc"), System.IO.Path.Combine(filePath, "config.adoc"));
- MoveDirectory(System.IO.Path.Combine(tempPath, "Images"), System.IO.Path.Combine(filePath, "Images")); // Directory.Move -> local MoveDirectory
- if (icon == true)
- {
- MoveDirectory(System.IO.Path.Combine(tempPath, "icons"), System.IO.Path.Combine(filePath, "icons"));// Directory.Move -> local MoveDirectory
- }
- if (sepa == true)
- {
- File.Move(System.IO.Path.Combine(tempPath, "IncDoc.adoc"), System.IO.Path.Combine(filePath, "IncDoc.adoc"));
- MoveDirectory(System.IO.Path.Combine(tempPath, "Sub_First"), System.IO.Path.Combine(filePath, "Sub_First"));// Directory.Move -> local MoveDirectory
- MoveDirectory(System.IO.Path.Combine(tempPath, "Sub_Second"), System.IO.Path.Combine(filePath, "Sub_Second"));// Directory.Move -> local MoveDirectory
- }
- }
-
///
/// ディレクトリを移動する。
///
/// 移動するディレクトリ
/// 移動先のディレクトリ
- /*
- ref: https://johobase.com/copy-directory-csharp/ [ディレクトリ(フォルダー)をコピーする [C#]]
- 最後に追加して、移動元のディレクトリをサブディレクトリ、ファイルを含めて削除
- Directory.Delete(sourceDirName, true);
- */
public static void MoveDirectory(string sourceDirName, string destDirName)
{
// コピー先のディレクトリがないかどうか判定する
@@ -151,7 +124,7 @@ namespace GetADoc
string[] dirs = Directory.GetDirectories(sourceDirName);
foreach (string dir in dirs)
{
- // コピー元のディレクトリのサブディレクトリで自メソッド(CopyDirectory)を再帰的に呼び出す
+ // コピー元のディレクトリのサブディレクトリで自メソッド(MoveDirectory)を再帰的に呼び出す
MoveDirectory(dir, destDirName + Path.GetFileName(dir));
}
Directory.Delete(sourceDirName, true);// 追加: 最後に元のフォルダを削除する
diff --git a/Release/GetADocGUI.exe b/Release/GetADocGUI.exe
index fc5ed18f6f449f61d064001fc6a89dac998f382b..d22b75027532d36a2ee8665427ecb1b922d98daa 100644
Binary files a/Release/GetADocGUI.exe and b/Release/GetADocGUI.exe differ
diff --git a/Release/GetADocGUI.pdb b/Release/GetADocGUI.pdb
index 57d964e818a4c69dea2afe177dfcc14cfb2a7b58..e7f52edf7b0a183541da53dbd3bc34ef38e3c600 100644
Binary files a/Release/GetADocGUI.pdb and b/Release/GetADocGUI.pdb differ