Beispiel #1
0
        /// <summary>
        /// 画面が表示された時に通知を受け取る。
        /// </summary>
        /// <param name="sender">送信元オブジェクト</param>
        /// <param name="e">イベントオブジェクト</param>
        private void OnFormShown(object sender, EventArgs e)
        {
            try
            {
                LoadOperations();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

            // オペレーションを更新
            UpdateComboboxItems();

            // 設定値を適用する。
            try
            {
                string dir  = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
                string path = System.IO.Path.Combine(dir, "operation.setting");
                if (System.IO.File.Exists(path))
                {
                    OperationSettingUtility.Load(path, operationList.ToArray());
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
Beispiel #2
0
 /// <summary>
 /// フォームがクローズされた時の処理を行う。
 /// </summary>
 /// <param name="sender">送信元オブジェクト</param>
 /// <param name="e">イベントオブジェクト</param>
 private void OnFormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         string dir      = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
         string fileName = "operation.setting";
         string path     = System.IO.Path.Combine(dir, fileName);
         OperationSettingUtility.Save(path, operationList.ToArray());
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.Write(ex);
     }
 }