OSDN Git Service

AppliStation-GUI,ExecutionProgressViewerにタスク終了時動作オプションを追加
[applistation/AppliStation.git] / AppliStation / AppliStation.Util / ExecutionProgressViewer.cs
index 2b99bfb..ea596d6 100644 (file)
@@ -18,6 +18,20 @@ namespace AppliStation.Util
                \r
                private Thread tasksetRunningThread = null;\r
                \r
+               /// <summary>\r
+               /// \8fI\97¹\8e\9e\82É\89½\82ð\8ds\82¤\82©\82Ì\83t\83\89\83O\r
+               /// </summary>\r
+               public enum ActionOnDoneFlags {\r
+                       None = 0,\r
+                       FlashWindow = 1,\r
+                       AutoCloseOnSuccess = 2,\r
+               }\r
+               \r
+               /// <summary>\r
+               /// \8fI\97¹\8e\9e\82É\89½\82ð\8ds\82¤\82©\r
+               /// </summary>\r
+               public ActionOnDoneFlags ActionOnDone = ActionOnDoneFlags.FlashWindow;\r
+               \r
                public Downloader Downloader {\r
                        get { return downloader; }\r
                }\r
@@ -143,9 +157,16 @@ namespace AppliStation.Util
                        }\r
                        \r
                        if (taskSet.Done) {\r
-                               NativeMethods.Form_FlashWindow(this,\r
+                               if ((ActionOnDone & ActionOnDoneFlags.FlashWindow) != 0) {\r
+                                       NativeMethods.Form_FlashWindow(this,\r
                                                               NativeMethods.FlashFlag.All | NativeMethods.FlashFlag.TimerNoFG,\r
                                                               uint.MaxValue, 0);\r
+                               }\r
+                               if (okButton.Enabled && (ActionOnDone & ActionOnDoneFlags.AutoCloseOnSuccess) != 0) {\r
+                                       this.DialogResult = DialogResult.OK;\r
+                                       Close();\r
+                                       Dispose();\r
+                               }\r
                        }\r
                }\r
                \r