diff --git a/GetADoc/App.config b/GetADoc/App.config
index 1d5d4bf4a5b625c61ad95a3e394b48e114c573fd..a2e15dc567567dcd2766ec2805bffdb0ef781c46 100644
--- a/GetADoc/App.config
+++ b/GetADoc/App.config
@@ -28,6 +28,18 @@
+
+ 0
+
+
+ False
+
+
+ False
+
+
+ False
+
\ No newline at end of file
diff --git a/GetADoc/GetADoc.csproj b/GetADoc/GetADoc.csproj
index 0f45af8a9395f7343e3ad827b1cc6961dc72f5ed..c9c29915f0ffee55dfa6cc73cd4e9db8441357f5 100644
--- a/GetADoc/GetADoc.csproj
+++ b/GetADoc/GetADoc.csproj
@@ -18,7 +18,7 @@
AnyCPU
true
- full
+ pdbonly
false
bin\Debug\
DEBUG;TRACE
@@ -27,7 +27,7 @@
AnyCPU
- pdbonly
+ none
true
bin\Release\
TRACE
@@ -38,6 +38,12 @@
adoc.ico
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll
+
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
+
..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.2\lib\Microsoft.WindowsAPICodePack.dll
@@ -49,6 +55,12 @@
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
@@ -67,7 +79,12 @@
MSBuild:Compile
Designer
+
+
+ ToggleSwitch.xaml
+
+
MSBuild:Compile
Designer
@@ -82,6 +99,14 @@
MainWindow.xaml
Code
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
@@ -116,4 +141,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/GetADoc/MainWindow.xaml b/GetADoc/MainWindow.xaml
index dc97c26a4670e4569673beee734f8e84b8c8a8f5..24b2983d08896f7b3d700e953edaf556d97e154a 100644
--- a/GetADoc/MainWindow.xaml
+++ b/GetADoc/MainWindow.xaml
@@ -1,43 +1,69 @@
+ Title="GetADoc" Height="380" Width="590" MinWidth="590" MinHeight="380" MaxHeight="380" MaxWidth="590">
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
<フォルダ指定>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/GetADoc/MainWindow.xaml.cs b/GetADoc/MainWindow.xaml.cs
index 18523498c458908491a40a8eddf7545283325494..84ab34756156c996a6858c50d1c1f91da628459d 100644
--- a/GetADoc/MainWindow.xaml.cs
+++ b/GetADoc/MainWindow.xaml.cs
@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -14,9 +15,15 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using System.Runtime.CompilerServices;
using Microsoft.Win32;
+using static GetADoc.WinAPI;
+using static System.ComponentModel.INotifyPropertyChanged;
using MSAPI = Microsoft.WindowsAPICodePack;
+using System.ComponentModel;
+using System.Windows.Controls.Primitives;
+using System.Reflection.Emit;
namespace GetADoc
{
@@ -28,11 +35,19 @@ namespace GetADoc
public MainWindow()
{
InitializeComponent();
+ DataContext = this;
//デフォルトに前回の設定を表示
ScreenCheckbox.IsChecked = Properties.Settings.Default.checkbox1Setting;
IconCheckbox.IsChecked = Properties.Settings.Default.checkbox2Setting;
SepaDocCheckbox.IsChecked = Properties.Settings.Default.checkbox3Setting;
+ FreePageCheckbox.IsChecked = Properties.Settings.Default.checkboxFree;
+ //RightClickCheckbox.IsChecked = Properties.Settings.Default.checkboxRight;
+ //if ((bool)RightClickCheckbox.IsChecked)
+ //{
+ // //RightClickCheckbox.Visibility = Visibility.Collapsed; //チェックボックスがONになっていれば非表示(過去に右クリック登録済み)
+ //}
+ ToggleButton.IsOn = Properties.Settings.Default.languageSetting;
//Pathの初期設定(引数指定で起動していれば引数のpath、指定していなければ前回の値)
string[] argPathBox = Environment.GetCommandLineArgs();
@@ -48,6 +63,39 @@ namespace GetADoc
//保存PathはデフォルトOFF
MyPathCheckbox.IsChecked = false;
+ //文書スタイルのコンボボックス定義
+ string NormalItem = "";
+ string QnAItem = "";
+ //string ForErrorItem = "";
+ string DesignItem = "";
+ string MeetingMemoItem = "";
+ if (ToggleButton.IsOn)
+ {
+ NormalItem = "Normal";
+ QnAItem = "QnA";
+ //ForErrorItem = "Troubleshooting";
+ DesignItem = "Basic Design";
+ MeetingMemoItem = "record of proceedings";
+ }
+ else
+ {
+ NormalItem = "ノーマル";
+ QnAItem = "QnA";
+ //ForErrorItem = "不具合解析";
+ DesignItem = "基本設計資料";
+ MeetingMemoItem = "議事録";
+ }
+ DocStileBox.Items.Add(NormalItem);
+ DocStileBox.Items.Add(QnAItem);
+ //DocStileBox.Items.Add(ForErrorItem);
+ DocStileBox.Items.Add(DesignItem);
+ DocStileBox.Items.Add(MeetingMemoItem);
+ //前回値を初期値に設定
+ DocStileBox.SelectedItem = DocStileBox.Items[Properties.Settings.Default.formatSetting];
+
+ //TitleLabelContent = "AsciiDocの雛形を作成します";
+ //Label1Content = "作成先のフォルダ:";
+
//ドラッグ&ドロップイベントの追加
allBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
allBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
@@ -114,7 +162,7 @@ namespace GetADoc
{
var selectFile = new MSAPI::Dialogs.CommonOpenFileDialog();
selectFile.IsFolderPicker = true;
- selectFile.Title = "フォルダを選択してください";
+ selectFile.Title = "Please Select Folder";
selectFile.InitialDirectory = @"C:";
if (selectFile.ShowDialog() != MSAPI::Dialogs.CommonFileDialogResult.Ok)
{
@@ -143,10 +191,24 @@ namespace GetADoc
SepaFlag = true;
}
+
+ //右クリック登録
+ //string InstTxt = RightClickInst.RunInst();
+
+ //RightClickCheckbox.IsChecked = true;
+ //RightClickCheckbox.Visibility = Visibility.Hidden;
+ //if (InstTxt != "")
+ //{
+ // RightClickCheckbox.IsChecked = false;
+ // RightClickCheckbox.Visibility = Visibility.Visible;
+ // CustomMsgBox.Show(mainWindow, "Right click shortcut installation failed. Error: " + InstTxt, "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
+ //}
+
+
//ファイルパスが指定されていない or 指定したフォルダが存在しない場合
if (FolderPathBox.Text == "" || !Directory.Exists(FolderPathBox.Text))
{
- CustomMsgBox.Show(mainWindow, "保存先が存在しません", "Save destination does not exist", MessageBoxButton.OK, MessageBoxImage.Warning);
+ CustomMsgBox.Show(mainWindow, "保存先が存在しません", "The specified folder does not exist.", MessageBoxButton.OK, MessageBoxImage.Warning);
Properties.Settings.Default.box1Setting = ""; //記憶していたパスを初期化
Properties.Settings.Default.Save();
return;
@@ -167,8 +229,14 @@ namespace GetADoc
if (fileName.IndexOfAny(NgChars) >= 0 || fileName.IndexOfAny(cutComma) >= 0)
{
fileName = RunBatch.NameCalibration(fileName);
- CustomMsgBox.Show(mainWindow, "ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。" +
- "\nもう一度作成ボタンをクリックしてください。", "Renamed this file", MessageBoxButton.OK, MessageBoxImage.Warning);
+
+ string ErrNameString = "ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。" + "\"\\nもう一度作成ボタンをクリックしてください。";
+ if (ToggleButton.IsOn)
+ {
+ ErrNameString = "Some file names have been modified because they contained invalid characters. Please click the Create button again.";
+ }
+
+ CustomMsgBox.Show(mainWindow, ErrNameString, "Renamed this file", MessageBoxButton.OK, MessageBoxImage.Warning);
ADocNameBox.Text = fileName;
return;
}
@@ -178,13 +246,23 @@ namespace GetADoc
|| Directory.Exists(System.IO.Path.Combine(filePath, "Images")) || Directory.Exists(System.IO.Path.Combine(filePath, "icons"))
|| Directory.Exists(System.IO.Path.Combine(filePath, "Sub_First")) || Directory.Exists(System.IO.Path.Combine(filePath, "Sub_Second")))
{
- MessageBoxResult OverwriteADoc = CustomMsgBox.Show(mainWindow, "これから生成するファイルと同名のファイルが既に存在します" +
- "\n既存のファイルを上書きしますか?" + "\n(Imageフォルダ内のファイルは維持されます)",
- "指定したフォルダに既存のファイルが存在します",
+ string SameNameMsg = "これから生成するファイルと同名のファイルが既に存在します" +
+ "\n既存のファイルを上書きしますか?" + "\n(Imageフォルダ内のファイルは維持されます)";
+ string SameNameHadder = "指定したフォルダに既存のファイルが存在します";
+
+ if (ToggleButton.IsOn)
+ {
+ SameNameMsg = "A file with the same name as the file you are about to generate already exists. " +
+ "Do you want to overwrite the existing file? (The file in the Image folder will be maintained.)";
+ SameNameHadder = "The same name already exists.";
+ }
+
+ MessageBoxResult OverwriteADoc = CustomMsgBox.Show(mainWindow, SameNameMsg,
+ SameNameHadder,
MessageBoxButton.YesNo, MessageBoxImage.None);
if (OverwriteADoc == MessageBoxResult.Yes)
{
-
+
}
else if (OverwriteADoc == MessageBoxResult.No)
{
@@ -205,11 +283,15 @@ namespace GetADoc
//処理の完了を知らせるラベルを表示
CompletedLabel.Visibility = Visibility.Visible;
- //指定されたファイルパスとチェックボックスを保存
+ //指定されたファイルパスとチェックボックス、コンボボックスを保存
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.checkboxRight = ((bool)RightClickCheckbox.IsChecked);
+ Properties.Settings.Default.checkboxFree= ((bool)FreePageCheckbox.IsChecked);
+ Properties.Settings.Default.formatSetting = ((int)DocStileBox.SelectedIndex);
+ Properties.Settings.Default.languageSetting = ((bool)ToggleButton.IsOn);
//保存PahtがTrueなら、そのときTextBoxに記載されているPathを保存
if (MyPathCheckbox.IsChecked == true)
@@ -222,12 +304,217 @@ namespace GetADoc
Properties.Settings.Default.Save();
}
+ private void RightInstRun(object sender, RoutedEventArgs e)
+ {
+ // カレントディレクトリを取得
+ string currentDirectory = Environment.CurrentDirectory;
+ currentDirectory += "\\.backup_registory\\InstAdocUI.js.bat.reg.txt";
+ if (File.Exists(currentDirectory))
+ {
+ string ErrMsg = "右クリックのショートカットは既に登録されているか、一度インストールした際の生成物が残留しています。マニュアルを確認してクリーンナップしてください。";
+ if (ToggleButton.IsOn)
+ {
+ ErrMsg = "Right-click shortcuts are already registered or there is residual data from a previous installation. Check the manual and clean it up.";
+ }
+ CustomMsgBox.Show(mainWindow, ErrMsg, "The associated file already exists",
+ MessageBoxButton.OK, MessageBoxImage.None);
+ return;
+ }
+
+ string InstTxt = RightClickInst.RunInst();
+
+ string OKMsg = "処理は正常終了しました。エクスプローラを開き、動作を確認して下さい";
+ if (ToggleButton.IsOn)
+ {
+ OKMsg = "The process was successful. Please open Explorer and check the operation.";
+ }
+ CustomMsgBox.Show(mainWindow, OKMsg, "The process was successful.",
+ MessageBoxButton.OK, MessageBoxImage.None);
+
+ }
+
//コントロール(テキストボックスなど)がフォーカスされたら処理完了のラベルを非表示にする
private void DeleteCompLabel(object sender, RoutedEventArgs e)
{
CompletedLabel.Visibility = Visibility.Hidden;
SavedLabel.Visibility = Visibility.Hidden;
}
+
+ private void LanguageChange(object sender, RoutedEventArgs e)
+ {
+ DataContext = this;
+ if (ToggleButton.IsOn)
+ {
+
+ //表記を日本語に切替
+ TitleLabel.Content = "AsciiDocの雛形を作成します";
+
+ label1.Content = "作成先のフォルダ:";
+ label2.Content = "ドキュメント名:";
+ label4.Content = "オプション:";
+ label5.Content = "文書フォーマット:";
+
+ if (FolderPathBox.Text == "