/// <summary> /// コンストラクタ /// </summary> /// <param name="log">共通ロジッククラスインスタンス</param> public Form1(MCSComLogic comLgc) { InitializeComponent(); this._comLgc = comLgc; // メインロジッククラスインスタンス生成 execRbcpy = new ExecRobocopy(this._comLgc); }
/// <summary> /// エントリーポイント /// </summary> /// <param name="args">コマンドライン引数配列</param> //****************************************************************************** public void Start(string[] args) { // ログ用メソッド名 string strMethodName = "Start"; bool bRet = true; try { // 処理開始ログ出力 this._comLgc.WriteLog(strMethodName + "開始"); // パラメータが無い場合 if (args.Length == 0) { // 画面起動 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1(this._comLgc)); return; } // ロボコピー実行クラス ExecRobocopy execRobocopy = new ExecRobocopy(this._comLgc, args); bRet = execRobocopy.ExecMain(); if (!bRet) { // 処理なし } } catch (Exception ex) { this._comLgc.WriteLog(ex.Message + ex.StackTrace); } finally { this._comLgc.WriteLog(strMethodName + "終了"); } }