/// <summary>
        /// 画像データ格納フォルダ選択エリアのドラッグEnterイベント
        /// </summary>
        /// <param name="sender">センダーオブジェクト</param>
        /// <param name="e">イベントデータ</param>
        private void ImageDirectory_DragEnter(object sender, DragEventArgs e)
        {
            // ドラッグされているデータが単一のフォルダかチェック
            bool checkResult = IsSingleFolder(e.Data, out string path);

            // ドラッグされているフォルダに画像データが存在するかチェック
            if (checkResult)
            {
                try
                {
                    checkResult = Directory.GetFiles(path).Any(filePath
                                                               => ImageTransform.CanImageLoad(filePath));
                }
                catch (Exception ex)
                    when(ex is UnauthorizedAccessException ||
                         ex is IOException)
                    {
                        // 下記の例外が発生した場合はチェック:NGにする
                        // UnauthorizedAccessException
                        // ・呼び出し元に、必要なアクセス許可がない場合
                        // IOException
                        // ・IOエラーが発生した場合
                        checkResult = false;
                    }
            }

            // チェックが正常の場合ドロップを受け入れる
            e.Effect = checkResult ? DragDropEffects.Move : DragDropEffects.None;
        }
        /// <summary>
        /// 画像データ格納フォルダ選択の選択ボタンを押下
        /// </summary>
        /// <param name="sender">センダーオブジェクト</param>
        /// <param name="e">イベントデータ</param>
        private void BtImageDirectorySelect_Click(object sender, EventArgs e)
        {
            // フォルダ選択ダイアログを開き、画像データが格納してあるフォルダを選択する
            FolderBrowserDialog dialog;

            using (dialog = new FolderBrowserDialog())
            {
                dialog.Description         = Resources.CombineImagesDirectorySelectDialogTitle;
                dialog.ShowNewFolderButton = false;
                if (Directory.Exists(TxtImageDirectory.Text))
                {
                    dialog.SelectedPath = TxtImageDirectory.Text;
                }

                // ダイアログを表示
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    // フォルダ選択でOKが押された場合、選択したファイルパスを取得
                    string folderPath = dialog.SelectedPath;

                    // 選択されたフォルダに画像データが存在するかチェック
                    try
                    {
                        if (Directory.GetFiles(folderPath).Any(filePath
                                                               => ImageTransform.CanImageLoad(filePath)))
                        {
                            // チェックOKの場合、選択したフォルダのパスを設定する
                            TxtImageDirectory.Text = folderPath;

                            // 実行エリアを使用可能とする
                            PlRun.Enabled = true;
                        }
                        else
                        {
                            // チェックNGの場合、エラーメッセージを表示する
                            MessageBox.ShowAttention(this, Resources.CombineImagesDirectoryErrorNotImage);
                        }
                    }
                    catch (Exception ex)
                        when(ex is UnauthorizedAccessException ||
                             ex is IOException)
                        {
                            // 下記の例外が発生した場合はメッセージを表示する
                            // UnauthorizedAccessException
                            // ・呼び出し元に、必要なアクセス許可がない場合
                            // IOException
                            // ・IOエラーが発生した場合
                            string message = Resources.CombineImagesDirectoryErrorNotAccess
                                             + "\r\n" + ex.Message;

                            MessageBox.ShowAttention(this, message);
                        }
                }
            }

            // 画面の表示設定を行う
            SetControlDisplaySetting();
        }
        /// <summary>
        /// 実行時に行う、画像データ格納フォルダに画像データが存在するかチェックする
        /// </summary>
        /// <param name="filePaths">画像データ格納フォルダのファイルリスト</param>
        /// <returns>チェック結果、チェックOK:True、NG:False</returns>
        private bool RunCheckImageFileExists(string[] filePaths)
        {
            // 画像データ格納フォルダに画像データが存在するかチェックする
            try
            {
                if (!filePaths.Any(imageFilePath
                                   => ImageTransform.CanImageLoad(imageFilePath)))
                {
                    // チェックNGの場合、エラーメッセージを表示し処理をしない
                    MessageBox.ShowAttention(this, Resources.CombineImagesDirectoryErrorNotImage);
                    return(false);
                }

                return(true);
            }
            catch (Exception ex)
            {
                // 下記のエラーの場合はメッセージを表示して処理をしない
                if (ex is ArgumentException ||
                    ex is PathTooLongException)
                {
                    // 下記のパスが不正の場合の例外の場合は、その旨のメッセージを表示し処理しない
                    // ArgumentException
                    // ・パスとして正しくない文字を含んで入る場合
                    // PathTooLongException
                    // ・指定したパスがシステム定義の最大長を超えている場合
                    string message = Resources.CombineImagesDirectoryErrorIncorrectPath
                                     + "\r\n" + ex.Message;
                    MessageBox.ShowAttention(this, message);
                    return(false);
                }
                else if (ex is DirectoryNotFoundException ||
                         ex is UnauthorizedAccessException ||
                         ex is IOException)
                {
                    // 下記のアクセスに関する例外の場合は、その旨のメッセージを表示し処理しない
                    // DirectoryNotFoundException:
                    // ・指定したディレクトリが見つからない場合
                    // UnauthorizedAccessException
                    // ・呼び出し元に、必要なアクセス許可がない場合
                    // IOException
                    // ・IOエラーが発生した場合
                    string message = Resources.CombineImagesDirectoryErrorNotAccess
                                     + "\r\n" + ex.Message;
                    MessageBox.ShowAttention(this, message);
                    return(false);
                }

                // 上記以外の例外の場合はそのままスローする
                throw;
            }
        }