Beispiel #1
0
        /* ----------------------------------------------------------------- */
        ///
        /// ShowOverwriteView
        ///
        /// <summary>
        /// 上書き確認用画面を表示します。
        /// </summary>
        ///
        /// <param name="e">情報を保持するオブジェクト</param>
        ///
        /* ----------------------------------------------------------------- */
        public override void ShowOverwriteView(OverwriteEventArgs e)
        {
            Assert.That(e.Source, Is.Not.Null);
            Assert.That(e.Destination, Is.Not.Null);

            e.Result = Settings.OverwriteMode;
        }
 /* ----------------------------------------------------------------- */
 ///
 /// ShowOverwriteView
 ///
 /// <summary>
 /// 上書き確認用画面を表示します。
 /// </summary>
 ///
 /// <param name="e">ファイル情報を保持するオブジェクト</param>
 ///
 /* ----------------------------------------------------------------- */
 public virtual void ShowOverwriteView(OverwriteEventArgs e)
 {
     using (var view = new OverwriteForm())
     {
         view.Source      = e.Source;
         view.Destination = e.Destination;
         view.ShowDialog();
         e.Result = view.OverwriteMode;
     }
 }
Beispiel #3
0
        /* ----------------------------------------------------------------- */
        ///
        /// RaiseOverwriteRequested
        ///
        /// <summary>
        /// OverwriteRequested イベントを発生させます。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void RaiseOverwriteRequested(Information src, Information dest)
        {
            var e = new OverwriteEventArgs(src, dest);

            OnOverwriteRequested(e);
            if (e.Result == OverwriteMode.Cancel)
            {
                throw new OperationCanceledException();
            }
            OverwriteMode = e.Result;
        }
 /* ----------------------------------------------------------------- */
 ///
 /// ShowOverwriteView
 ///
 /// <summary>
 /// 上書き確認用画面を表示します。
 /// </summary>
 ///
 /// <param name="e">ファイル情報を保持するオブジェクト</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void ShowOverwriteView(OverwriteEventArgs e) =>
 _factory.ShowOverwriteView(e);
 /* ----------------------------------------------------------------- */
 ///
 /// WhenOverwriteRequested
 ///
 /// <summary>
 /// 上書き確認時に実行されるハンドラです。
 /// </summary>
 ///
 /* ----------------------------------------------------------------- */
 private void WhenOverwriteRequested(object s, OverwriteEventArgs e) =>
 ShowDialog(() => Views.ShowOverwriteView(e));