diff --git a/Code/CSRender/CSRender.sln b/Code/CSRender/CSRender.sln
new file mode 100644
index 0000000000000000000000000000000000000000..f02f53065160866e161404ae6f8c753725dac3d0
--- /dev/null
+++ b/Code/CSRender/CSRender.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.1684
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSRender", "CSRender\CSRender.csproj", "{135D5283-7F43-4946-B3D8-786ED901D457}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {135D5283-7F43-4946-B3D8-786ED901D457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {135D5283-7F43-4946-B3D8-786ED901D457}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {135D5283-7F43-4946-B3D8-786ED901D457}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {135D5283-7F43-4946-B3D8-786ED901D457}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {50369CFE-25D5-4DB7-B57F-A19F1248BD22}
+ EndGlobalSection
+EndGlobal
diff --git a/Code/CSRender/CSRender/App.config b/Code/CSRender/CSRender/App.config
new file mode 100644
index 0000000000000000000000000000000000000000..00bfd114afa09381b01f0115be71b65a8ba9284e
--- /dev/null
+++ b/Code/CSRender/CSRender/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Code/CSRender/CSRender/App.xaml b/Code/CSRender/CSRender/App.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..743fe5275fd138f5dd88991893e93d18ef888341
--- /dev/null
+++ b/Code/CSRender/CSRender/App.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/Code/CSRender/CSRender/App.xaml.cs b/Code/CSRender/CSRender/App.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ab246b776877c9aef7504fc4ea1a8909cb69442a
--- /dev/null
+++ b/Code/CSRender/CSRender/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace CSRender
+{
+ ///
+ /// App.xaml の相互作用ロジック
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Code/CSRender/CSRender/CSRender.csproj b/Code/CSRender/CSRender/CSRender.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..f3d53b54f6358675b43dd04e100ef3247032dbe6
--- /dev/null
+++ b/Code/CSRender/CSRender/CSRender.csproj
@@ -0,0 +1,114 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {135D5283-7F43-4946-B3D8-786ED901D457}
+ WinExe
+ CSRender
+ CSRender
+ v4.6.1
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.2\lib\Microsoft.WindowsAPICodePack.dll
+
+
+ ..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll
+
+
+ ..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+
+
+
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Code/CSRender/CSRender/ComboBox.cs b/Code/CSRender/CSRender/ComboBox.cs
new file mode 100644
index 0000000000000000000000000000000000000000..22930fbd4914f12a59dcf08bce67d4c853658a16
--- /dev/null
+++ b/Code/CSRender/CSRender/ComboBox.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+
+namespace CSRender
+{
+ public partial class MainWindow : Window
+ {
+ //コンボボックスの要素
+ public class ComboBoxSet
+ {
+ public int Id { get; set; }
+ public string Item { get; set; }
+ }
+
+ //クリックしたときに全体を選択
+ private void PageBox_GotFocusSelectAll(object sender, RoutedEventArgs e)
+ {
+ TextBox box = (TextBox)sender;
+ //box.SelectAll();
+ this.Dispatcher.InvokeAsync(() => { Task.Delay(10); box.SelectAll(); });
+ }
+
+ //ページ指定のプルダウンに応じてテキストボックスを活性化/非活性化
+ private void PageRange_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ var SelectedItem = (ComboBoxSet)PageRange.SelectedItem;
+ if (SelectedItem == null) return;
+ string PageType = (string)SelectedItem.Item;
+ if(PageType == "指定")
+ {
+ pageBox.IsEnabled = true;
+ pageLabel.IsEnabled = true;
+ }
+ else
+ {
+ pageBox.IsEnabled = false;
+ pageLabel.IsEnabled = false;
+ }
+ }
+
+ }
+
+
+}
diff --git a/Code/CSRender/CSRender/CompareButtonSetting.cs b/Code/CSRender/CSRender/CompareButtonSetting.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6648fd625cc142dd60ea76e560ff0adc69684aea
--- /dev/null
+++ b/Code/CSRender/CSRender/CompareButtonSetting.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+using System.Diagnostics;
+using System.IO;
+
+namespace CSRender
+{
+ public partial class MainWindow : Window
+ {
+ private void CompareButtonClick(object sender, RoutedEventArgs e)
+ {
+ ProcessStartInfo processStartInfo = new ProcessStartInfo();
+ string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
+ string exePath = System.IO.Path.Combine("PureVerify.Data", "RipVerify", "bin", "x64");
+ processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, exePath, "PureVerify.exe");
+ processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示
+ processStartInfo.UseShellExecute = false; // シェル機能オフ
+ processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト
+
+ //引数設定
+ //指定ファイル
+ processStartInfo.Arguments = "/tar ";
+ if (!Directory.Exists(targetBox.Text) && !File.Exists(targetBox.Text))//pathのチェック
+ {
+ CustomMsgBox.Show(mainWindow, "指定されたファイルあるいはフォルダが存在しません。" +
+ "\nもう一度設定してください。", "The specified file or folder does not exist", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ processStartInfo.Arguments += targetBox.Text;
+
+ //リファレンスファイル
+ if (!Directory.Exists(referenceBox.Text) && !File.Exists(referenceBox.Text))//pathのチェック
+ {
+ CustomMsgBox.Show(mainWindow, "指定されたリファレンスファイルあるいはフォルダが存在しません。" +
+ "\nもう一度設定してください。", "The specified reference file or folder does not exist", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ processStartInfo.Arguments += " /ref ";
+ processStartInfo.Arguments += referenceBox.Text;
+
+ //EquiosCenterの場所
+ string EquiosCenter = System.IO.Path.Combine(stCurrentDir, "PureVerify.Data", "EquiosCenter_small");
+ processStartInfo.Arguments += " /equios ";
+ processStartInfo.Arguments += EquiosCenter;
+
+ //出力ファイル形式の引数
+ processStartInfo.Arguments += " /work ";
+
+ if (!Directory.Exists(workBox.Text) && !File.Exists(workBox.Text))//pathのチェック
+ {
+ CustomMsgBox.Show(mainWindow, "指定された作業フォルダが存在しません。" +
+ "\nもう一度設定してください。", "The specified reference file or folder does not exist", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ //processStartInfo.Arguments += workBox.Text;
+ string workDir = System.IO.Path.Combine(stCurrentDir, "PureVerify.Data", "RipVerify");
+ processStartInfo.Arguments += workDir;
+
+
+ //検版の指定(2だとNGログ検版(LOG-Diff)になる)
+ processStartInfo.Arguments += " /operation \"1\"";
+ //差異箇所マークのサイズを指定
+ processStartInfo.Arguments += " /markdis \"50\"";
+ //PDFReportの画像の圧縮形式(0:ZLIB、1:LZW、2:JPEG、3:JPEG2000、4:RUN_LENGTH)
+ processStartInfo.Arguments += " /encode \"1\"";
+ //検版結果OKとなったファイルリストをPDFレポートの最後に記載(0:記載しない、1:記載する)
+ processStartInfo.Arguments += " /show \"1\"";
+ //検版品質ファイルの選択(0:弱、1:中、2:強、3:カスタム)
+ processStartInfo.Arguments += " /quality \"2\"";
+
+ //CSRender.exeを実行
+ Process process = Process.Start(processStartInfo);
+ //ResultConsole.Text = process.StandardOutput.ReadToEnd();
+ process.OutputDataReceived += process_DataReceived;
+ process.BeginOutputReadLine();
+ //ResultConsole.ScrollToEnd();
+ process.WaitForExit();
+ process.Close();
+
+ //指定先にレポートを移動
+ string reportPath = System.IO.Path.Combine(workBox.Text, "report");
+ if (!Directory.Exists(reportPath))//指定先にreportフォルダがあるか
+ {
+ Directory.CreateDirectory(reportPath);//なければ新規でreportフォルダを作成
+ }
+ var allReport = Directory.EnumerateFiles(System.IO.Path.Combine(workDir, "report")
+ , "*", SearchOption.TopDirectoryOnly);//reportフォルダ内の全てのファイルを取得
+ foreach (string file in allReport)
+ {
+ string fileTarget = System.IO.Path.GetFileName(file);
+ File.Move(file, System.IO.Path.Combine(reportPath, fileTarget));//指定先に移動
+ }
+ }
+
+ //コンソール出力を読み取りする関数
+ public void process_DataReceived(object sender, DataReceivedEventArgs e)
+ {
+ string VerifyResult = e.Data;
+ Dispatcher.BeginInvoke(new Action(() =>
+ {
+ ResultConsole.Text = VerifyResult;
+ ResultConsole.ScrollToEnd();
+ }));
+ }
+
+ private string outputLog(string workDir)
+ {
+ StreamReader logString = new StreamReader(System.IO.Path.Combine(workDir, "report" + "hironimo.txt"));
+ string toString = "";
+ string tranceString = logString + toString;
+ string cutString = "*****************************************************" + "\r\n"
+ + "Number of Processors = 8" + "\r\n"
+ + "HostName = I-N-21-00008" + "\r\n"
+ + "PlatformId = 0" + "\r\n" + "PureVerifyMainSetUp.txt" + "\r\n"
+ + " MakeThreadNums = 0" + " PDFREPORT_SPLIT_PAGENUM = 32" + "\r\n"
+ + "*****************************************************";
+ string outputString = tranceString.Replace(cutString, "");
+ return outputString;
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/CustomMsgBox.cs b/Code/CSRender/CSRender/CustomMsgBox.cs
new file mode 100644
index 0000000000000000000000000000000000000000..deab80b3c7562b9bb57dc77341ff16c5724d6bb9
--- /dev/null
+++ b/Code/CSRender/CSRender/CustomMsgBox.cs
@@ -0,0 +1,168 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
+using System.Runtime.InteropServices;
+
+namespace CSRender
+{
+ class CustomMsgBox
+ {
+ ///
+ /// 親ウィンドウ
+ ///
+ private Window ownerWindow = null;
+
+ ///
+ /// フックハンドル
+ ///
+ private IntPtr hHook = IntPtr.Zero;
+
+ ///
+ /// メッセージボックスを表示する
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static MessageBoxResult Show(
+ Window owner,
+ string messageBoxText,
+ string caption,
+ MessageBoxButton button,
+ MessageBoxImage icon)
+ {
+
+ if (owner.WindowState == WindowState.Minimized)
+ {
+ return MessageBox.Show(owner, messageBoxText, caption, button, icon);
+ }
+ else
+ {
+ CustomMsgBox mbox = new CustomMsgBox(owner);
+ return mbox.Show(messageBoxText, caption, button, icon);
+ }
+ }
+
+ ///
+ /// コンストラクタ
+ ///
+ /// Owner Window
+ private CustomMsgBox(Window window)
+ {
+ ownerWindow = window;
+ }
+
+ ///
+ /// メッセージボックスを表示する
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private MessageBoxResult Show(
+ string messageBoxText,
+ string caption,
+ MessageBoxButton button,
+ MessageBoxImage icon)
+ {
+ // フックを設定する。
+ HwndSource hwndSource = (HwndSource)HwndSource.FromVisual(ownerWindow);
+ IntPtr hInstance = WinAPI.GetWindowLong(hwndSource.Handle, WinAPI.GWL_HINSTANCE);
+ IntPtr threadId = WinAPI.GetCurrentThreadId();
+ hHook = WinAPI.SetWindowsHookEx(WinAPI.WH_CBT, new WinAPI.HOOKPROC(HookProc), hInstance, threadId);
+
+ return MessageBox.Show(ownerWindow, messageBoxText, caption, button, icon);
+ }
+
+ ///
+ /// フックプロシージャ
+ ///
+ ///
+ ///
+ ///
+ ///
+ private IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam)
+ {
+
+ if (nCode == WinAPI.HCBT_ACTIVATE)
+ {
+ WinAPI.RECT rcForm = new WinAPI.RECT(0, 0, 0, 0);
+ WinAPI.RECT rcMsgBox = new WinAPI.RECT(0, 0, 0, 0);
+
+ HwndSource hwndSource = (HwndSource)HwndSource.FromVisual(ownerWindow);
+ WinAPI.GetWindowRect(hwndSource.Handle, out rcForm);
+ WinAPI.GetWindowRect(wParam, out rcMsgBox);
+
+ // センター位置を計算する。
+ int x = (rcForm.Left + (rcForm.Right - rcForm.Left) / 2) - ((rcMsgBox.Right - rcMsgBox.Left) / 2);
+ int y = (rcForm.Top + (rcForm.Bottom - rcForm.Top) / 2) - ((rcMsgBox.Bottom - rcMsgBox.Top) / 2);
+
+ WinAPI.SetWindowPos(wParam, 0, x, y, 0, 0, WinAPI.SWP_NOSIZE | WinAPI.SWP_NOZORDER | WinAPI.SWP_NOACTIVATE);
+
+ IntPtr result = WinAPI.CallNextHookEx(hHook, nCode, wParam, lParam);
+
+ // フックを解除する。
+ WinAPI.UnhookWindowsHookEx(hHook);
+ hHook = IntPtr.Zero;
+
+ return result;
+
+ }
+ else
+ {
+ return WinAPI.CallNextHookEx(hHook, nCode, wParam, lParam);
+ }
+ }
+ }
+
+ internal class WinAPI
+ {
+ [DllImport("user32.dll")]
+ public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);
+ [DllImport("kernel32.dll")]
+ public static extern IntPtr GetCurrentThreadId();
+ [DllImport("user32.dll")]
+ public static extern IntPtr SetWindowsHookEx(int idHook, HOOKPROC lpfn, IntPtr hInstance, IntPtr threadId);
+ [DllImport("user32.dll")]
+ public static extern bool UnhookWindowsHookEx(IntPtr hHook);
+ [DllImport("user32.dll")]
+ public static extern IntPtr CallNextHookEx(IntPtr hHook, int nCode, IntPtr wParam, IntPtr lParam);
+ [DllImport("user32.dll")]
+ public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
+ [DllImport("user32.dll")]
+ public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
+
+ public delegate IntPtr HOOKPROC(int nCode, IntPtr wParam, IntPtr lParam);
+
+ public const int GWL_HINSTANCE = (-6);
+ public const int WH_CBT = 5;
+ public const int HCBT_ACTIVATE = 5;
+
+ public const int SWP_NOSIZE = 0x0001;
+ public const int SWP_NOZORDER = 0x0004;
+ public const int SWP_NOACTIVATE = 0x0010;
+
+ public struct RECT
+ {
+ public RECT(int inLeft, int inTop, int inRight, int inBottom)
+ {
+ Left = inLeft;
+ Top = inTop;
+ Right = inRight;
+ Bottom = inBottom;
+ }
+
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/FilePathSelect.cs b/Code/CSRender/CSRender/FilePathSelect.cs
new file mode 100644
index 0000000000000000000000000000000000000000..31b0d64a2cdfaac0d52d07701f34570067265741
--- /dev/null
+++ b/Code/CSRender/CSRender/FilePathSelect.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+using Microsoft.Win32;
+using MSAPI = Microsoft.WindowsAPICodePack;
+
+namespace CSRender
+{
+ public partial class MainWindow : Window
+ {
+ //フォルダ指定のためにファイルをドラッグ
+ private void textBox_PreviewDragOver(object sender, System.Windows.DragEventArgs e)
+ {
+ if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop, true))
+ {
+ e.Effects = System.Windows.DragDropEffects.Copy;
+ }
+ else
+ {
+ e.Effects = System.Windows.DragDropEffects.None;
+ }
+ e.Handled = true;
+ }
+
+ //エクスプローラーからテキストボックスにドロップして指定フォルダの場所をペースト
+ private void TargetBox_Drop(object sender, System.Windows.DragEventArgs e)
+ {
+ var dropFiles = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];
+ if (dropFiles == null) return;
+ //カーソルを終端に置く
+ targetBox.Text = dropFiles[0];
+ targetBox.Focus();
+ targetBox.Select(this.targetBox.Text.Length, 0);
+ }
+ private void RefBox_Drop(object sender, System.Windows.DragEventArgs e)
+ {
+ var dropFiles = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];
+ if (dropFiles == null) return;
+ //カーソルを終端に置く
+ referenceBox.Text = dropFiles[0];
+ referenceBox.Focus();
+ referenceBox.Select(this.referenceBox.Text.Length, 0);
+ }
+ private void WorkBox_Drop(object sender, System.Windows.DragEventArgs e)
+ {
+ var dropFiles = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];
+ if (dropFiles == null) return;
+ //カーソルを終端に置く
+ workBox.Text = dropFiles[0];
+ workBox.Focus();
+ workBox.Select(this.workBox.Text.Length, 0);
+ }
+
+ //参照ボタンClickでフォルダ選択のダイアログを表示(対象フォルダ)
+ private void TagetButton_Click(object sender, RoutedEventArgs e)
+ {
+ //ファイル選択の場合
+ //var selectFile = new OpenFileDialog();
+ //selectFile.Title = "ファイルを選択してください";
+ //selectFile.InitialDirectory = @"C:";
+ //if ((bool)selectFile.ShowDialog())
+ //{
+ //FileName = selectFile.FileName;
+ //FileSelected(this, new EventArgs());
+ //}
+
+ //フォルダ選択の場合
+ var selectFile = new MSAPI::Dialogs.CommonOpenFileDialog();
+ selectFile.IsFolderPicker = true;
+ selectFile.Title = "フォルダを選択してください";
+ selectFile.InitialDirectory = @"C:";
+ if (selectFile.ShowDialog() != MSAPI::Dialogs.CommonFileDialogResult.Ok)
+ {
+ return;
+ }
+ //共通部分
+ targetBox.Text = selectFile.FileName;
+ }
+
+ //参照ボタンClickでフォルダ選択のダイアログを表示(リファレンスフォルダ)
+ private void ReferenceButton_Click(object sender, RoutedEventArgs e)
+ {
+ //ファイル選択の場合
+ //var selectFile = new OpenFileDialog();
+ //selectFile.Title = "ファイルを選択してください";
+ //selectFile.InitialDirectory = @"C:";
+ //if ((bool)selectFile.ShowDialog())
+ //{
+ //FileName = selectFile.FileName;
+ //FileSelected(this, new EventArgs());
+ //}
+
+ //フォルダ選択の場合
+ var selectFile = new MSAPI::Dialogs.CommonOpenFileDialog();
+ selectFile.IsFolderPicker = true;
+ selectFile.Title = "フォルダを選択してください";
+ selectFile.InitialDirectory = @"C:";
+ if (selectFile.ShowDialog() != MSAPI::Dialogs.CommonFileDialogResult.Ok)
+ {
+ return;
+ }
+ //共通部分
+ referenceBox.Text = selectFile.FileName;
+ }
+
+ //参照ボタンClickでフォルダ選択のダイアログを表示(作業フォルダ)
+ private void WorkButton_Click(object sender, RoutedEventArgs e)
+ {
+ //ファイル選択の場合
+ //var selectFile = new OpenFileDialog();
+ //selectFile.Title = "ファイルを選択してください";
+ //selectFile.InitialDirectory = @"C:";
+ //if ((bool)selectFile.ShowDialog())
+ //{
+ //FileName = selectFile.FileName;
+ //FileSelected(this, new EventArgs());
+ //}
+
+ //フォルダ選択の場合
+ var selectFile = new MSAPI::Dialogs.CommonOpenFileDialog();
+ selectFile.IsFolderPicker = true;
+ selectFile.Title = "フォルダを選択してください";
+ selectFile.InitialDirectory = @"C:";
+ if (selectFile.ShowDialog() != MSAPI::Dialogs.CommonFileDialogResult.Ok)
+ {
+ return;
+ }
+ //共通部分
+ workBox.Text = selectFile.FileName;
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/MainWindow.xaml b/Code/CSRender/CSRender/MainWindow.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..d0441a98a829c59bbcbddb4359f5e8830c4e5aac
--- /dev/null
+++ b/Code/CSRender/CSRender/MainWindow.xaml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Code/CSRender/CSRender/MainWindow.xaml.cs b/Code/CSRender/CSRender/MainWindow.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..216f69cafc613ab1d3065d24eda5171ebcbac334
--- /dev/null
+++ b/Code/CSRender/CSRender/MainWindow.xaml.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+using System.Collections.ObjectModel;
+
+namespace CSRender
+{
+ ///
+ /// MainWindow.xaml の相互作用ロジック
+ ///
+ public partial class MainWindow : Window
+ {
+ //comboBoxのインスタンス
+ private ObservableCollection PagePattern = new ObservableCollection();
+ private ObservableCollection FilePattern = new ObservableCollection();
+ public MainWindow()
+ {
+ InitializeComponent();
+
+ //解像度選択UpDownバーの設定
+ this.Title = this.ToString();
+ ResolutionBox.MouseWheel += NumericTextBox_MouseWheel;
+ ResolutionBox.GotFocus += NumericTextBox_GotFocusSelectAll;
+ ResolutionBox.TextChanged += NumericTextBox_TextChanged;
+ ResolutionBox.TextChanged += NumericTextBox_NumChanged;
+ NumericScroll1.MouseWheel += NumericScroll1_MouseWheel;
+
+
+ //ページ入力メニューの設定
+ PagePattern.Add((new ComboBoxSet { Id = 1, Item = "全ページ"}));
+ PagePattern.Add((new ComboBoxSet { Id = 2, Item = "指定" }));
+ PageRange.ItemsSource = PagePattern;
+
+ pageBox.GotFocus += PageBox_GotFocusSelectAll;
+
+ //出力ファイル形式メニューの設定
+ FilePattern.Add((new ComboBoxSet { Id = 1, Item = "JPG" }));
+ FilePattern.Add((new ComboBoxSet { Id = 2, Item = "JPEG" }));
+ FilePattern.Add((new ComboBoxSet { Id = 3, Item = "PNG" }));
+ FilePattern.Add((new ComboBoxSet { Id = 4, Item = "TIF" }));
+ FilePattern.Add((new ComboBoxSet { Id = 5, Item = "TIFF" }));
+ FilePattern.Add((new ComboBoxSet { Id = 6, Item = "GIF" }));
+ FilePattern.Add((new ComboBoxSet { Id = 7, Item = "BMP" }));
+ FileSelect.ItemsSource = FilePattern;
+
+ //ドラッグ&ドロップイベントの追加
+ targetBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
+ targetBox.AddHandler(TextBox.DropEvent, new DragEventHandler(TargetBox_Drop), true);
+ referenceBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
+ referenceBox.AddHandler(TextBox.DropEvent, new DragEventHandler(RefBox_Drop), true);
+ workBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
+ workBox.AddHandler(TextBox.DropEvent, new DragEventHandler(WorkBox_Drop), true);
+ }
+
+ //Closeボタン
+ private void CloseButton_Click(object sender, RoutedEventArgs e) =>
+ Close();
+
+ }
+}
diff --git a/Code/CSRender/CSRender/NumericUpDown.cs b/Code/CSRender/CSRender/NumericUpDown.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c44dd306f935b5435c6a11b5532e6ab927cd0191
--- /dev/null
+++ b/Code/CSRender/CSRender/NumericUpDown.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+
+namespace CSRender
+{
+ public partial class MainWindow : Window
+ {
+
+ ////////////////////////////////////////////////////////////////////////////
+ // 解像度のUpDownメニュー昨日の記述
+ ////////////////////////////////////////////////////////////////////////////
+
+ //TextBoxフォーカス時にテキスト全選択
+ private void NumericTextBox_GotFocusSelectAll(object sender, RoutedEventArgs e)
+ {
+ TextBox box = (TextBox)sender;
+ //box.SelectAll();
+ this.Dispatcher.InvokeAsync(() => { Task.Delay(10); box.SelectAll(); });
+ }
+
+ //正規表現で数値以外は削除using System.Text.RegularExpressions;
+ private void NumericTextBox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ TextBox box = (TextBox)sender;
+ double d;
+ if (!double.TryParse(box.Text, out d))
+ {
+ box.Text = Regex.Replace(box.Text, "[^0-9-]", "");
+ }
+ }
+
+ //数字の下限;
+ private void NumericTextBox_NumChanged(object sender, TextChangedEventArgs e)
+ {
+ TextBox box = (TextBox)sender;
+ if (box.Text == "")
+ {
+ box.Text = "72";
+ }
+ NumericScroll1.Value = Int32.Parse(box.Text);
+ }
+
+ //TextBox上でマウスホイールを回転させた時にスクロールバーの値を上下させる
+ private void NumericTextBox_MouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ TextBox textBox = (TextBox)sender;
+ Binding binding = BindingOperations.GetBinding(textBox, TextBox.TextProperty);
+ ScrollBar scrollBar = (ScrollBar)this.FindName(binding.ElementName);//名前から取得
+ scrollBar.Value = Int32.Parse(textBox.Text);
+ if (e.Delta > 0)
+ {
+ scrollBar.Value++;
+ }
+ else
+ {
+ scrollBar.Value--;
+ }
+ }
+ //ScrollBar上でマウスホイールを回転させた時にScrollBarの値を上下させる
+ private void NumericScroll1_MouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ ScrollBar sb = (ScrollBar)sender;
+ sb.Value = Int32.Parse(ResolutionBox.Text);
+ if (e.Delta > 0)
+ {
+ sb.Value++;
+ }
+ else
+ {
+ sb.Value--;
+ }
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/Properties/AssemblyInfo.cs b/Code/CSRender/CSRender/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..45f89b3efe7d06c228a5e57666087a6b918b2710
--- /dev/null
+++ b/Code/CSRender/CSRender/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
+// アセンブリに関連付けられている情報を変更するには、
+// これらの属性値を変更してください。
+[assembly: AssemblyTitle("CSRender")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CSRender")]
+[assembly: AssemblyCopyright("Copyright © 2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
+// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
+// その型の ComVisible 属性を true に設定してください。
+[assembly: ComVisible(false)]
+
+//ローカライズ可能なアプリケーションのビルドを開始するには、
+//.csproj ファイルの CultureYouAreCodingWith を
+// 内部で設定します。たとえば、
+//ソース ファイルで英語を使用している場合、 を en-US に設定します。次に、
+//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
+//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ //またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
+ ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
+)]
+
+
+// アセンブリのバージョン情報は次の 4 つの値で構成されています:
+//
+// メジャー バージョン
+// マイナー バージョン
+// ビルド番号
+// Revision
+//
+// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
+// 既定値にすることができます:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Code/CSRender/CSRender/Properties/Resources.Designer.cs b/Code/CSRender/CSRender/Properties/Resources.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..789a32ea2b37dc9c1397a733731a6a37463df38b
--- /dev/null
+++ b/Code/CSRender/CSRender/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします
+//
+//------------------------------------------------------------------------------
+
+namespace CSRender.Properties
+{
+
+
+ ///
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ ///
+ // このクラスは StronglyTypedResourceBuilder クラスによって ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをリビルドします。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CSRender.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/Properties/Resources.resx b/Code/CSRender/CSRender/Properties/Resources.resx
new file mode 100644
index 0000000000000000000000000000000000000000..ffecec851ab4deae63e81647b4655c7d1fe6dfd7
--- /dev/null
+++ b/Code/CSRender/CSRender/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Code/CSRender/CSRender/Properties/Settings.Designer.cs b/Code/CSRender/CSRender/Properties/Settings.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..20d4e8608d25a299c478d1a0c894e14ca3568de7
--- /dev/null
+++ b/Code/CSRender/CSRender/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace CSRender.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/Properties/Settings.settings b/Code/CSRender/CSRender/Properties/Settings.settings
new file mode 100644
index 0000000000000000000000000000000000000000..8f2fd95d626cc8451ccec1b2bcd6419e91491c31
--- /dev/null
+++ b/Code/CSRender/CSRender/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Code/CSRender/CSRender/TIFFButtonsSetting.cs b/Code/CSRender/CSRender/TIFFButtonsSetting.cs
new file mode 100644
index 0000000000000000000000000000000000000000..f0e1424fe92ca8e4eecae5dbbfd4acc84698300b
--- /dev/null
+++ b/Code/CSRender/CSRender/TIFFButtonsSetting.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Controls.Primitives;
+using System.Text.RegularExpressions;
+using System.Diagnostics;
+using System.IO;
+
+namespace CSRender
+{
+ public partial class MainWindow : Window
+ {
+ private void TIFFButtonClick(object sender, RoutedEventArgs e)
+ {
+ ProcessStartInfo processStartInfo = new ProcessStartInfo();
+ string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
+ processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, "CSRender.Data", "CSRender.exe");
+ processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示
+ processStartInfo.UseShellExecute = false; // シェル機能オフ
+ processStartInfo.RedirectStandardOutput = true;//標準出力をリダイレクト
+
+ //解像度の引数
+ if (NumericScroll1.Value < 9)
+ {
+ CustomMsgBox.Show(mainWindow, "解像度が正しく設定されていません。" +
+ "\nもう一度設定してください。", "The resolution value is not set correctly", MessageBoxButton.OK, MessageBoxImage.Information);
+ ResolutionBox.Text = "9";
+ return;
+ }
+ processStartInfo.Arguments = "/D ";
+ processStartInfo.Arguments += ResolutionBox.Text;
+
+ //出力ファイル形式の引数
+ processStartInfo.Arguments += " /";
+ processStartInfo.Arguments += FileSelect.Text;
+ processStartInfo.Arguments += " ";
+
+ //必要に応じてページ引数を指定
+ if (PageRange.Text == "指定")
+ {
+ processStartInfo.Arguments += "/P \"";
+ processStartInfo.Arguments += pageBox.Text;
+ processStartInfo.Arguments += "\" ";
+ }
+
+ //指定ファイル
+ if (!Directory.Exists(targetBox.Text) && !File.Exists(targetBox.Text))//pathが存在するかチェック
+ {
+ CustomMsgBox.Show(mainWindow, "指定されたファイルあるいはフォルダが存在しません。" +
+ "\nもう一度設定してください。", "The specified file or folder does not exist", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ processStartInfo.Arguments += "/F ";
+ processStartInfo.Arguments += targetBox.Text;
+
+ //出力フォルダ
+ if(workBox.Text != "")
+ {
+ if (!Directory.Exists(workBox.Text) && !File.Exists(workBox.Text))//pathのチェック
+ {
+ CustomMsgBox.Show(mainWindow, "指定された作業フォルダが存在しません。" +
+ "\nもう一度設定してください。", "The specified reference file or folder does not exist", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+ }
+ processStartInfo.Arguments += " /O ";
+ processStartInfo.Arguments += workBox.Text;
+ }
+
+ //CSRender.exeを実行
+ Process process = Process.Start(processStartInfo);
+ ResultConsole.Text = process.StandardOutput.ReadToEnd();
+ ResultConsole.ScrollToEnd();
+ process.WaitForExit();
+ process.Close();
+ }
+ }
+}
diff --git a/Code/CSRender/CSRender/packages.config b/Code/CSRender/CSRender/packages.config
new file mode 100644
index 0000000000000000000000000000000000000000..ffbe02d95675383b267230b25a0dc48f4958afff
--- /dev/null
+++ b/Code/CSRender/CSRender/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file