• R/O
  • SSH
  • HTTPS

kotoli: Commit


Commit MetaInfo

Revision211 (tree)
Time2010-07-24 13:18:35
Authorsgry

Log Message

修正)非GUIスレッドからGUIへアクセスしないように(Windowsプログラミングのマナー違反)

Change Summary

Incremental Difference

--- trunk/Kotoli/KotoliForm.cs (revision 210)
+++ trunk/Kotoli/KotoliForm.cs (revision 211)
@@ -8,7 +8,6 @@
88 using System.Windows.Forms;
99 using System.Reflection;
1010 using Debug = System.Diagnostics.Debug;
11-using Timer = System.Threading.Timer;
1211 using ThreadStart = System.Threading.ThreadStart;
1312 using Timeout = System.Threading.Timeout;
1413 using Sgry;
@@ -25,7 +24,6 @@
2524 TreeNode _selectedNode = null; // Copy, Cutの一時保存用 _LastSelectedNodeと共用できそうならする方針で
2625 bool? _isCopy = null;
2726 bool _isAskingToUser = false;
28- Timer _timer;
2927 Sgry.Azuki.SearchResult _lastFound = null;
3028 public Sgry.Ini _ini = null;
3129
@@ -957,9 +955,15 @@
957955 && _isAskingToUser == false )
958956 {
959957 _isAskingToUser = true;
960- _timer = new Timer(
961- AskUserAndSaveMemo, null, 100, Timeout.Infinite
962- );
958+
959+ Timer timer = new Timer();
960+ timer.Interval = 100;
961+ timer.Tick += delegate {
962+ timer.Enabled = false;
963+ timer.Dispose();
964+ AskUserAndSaveMemo( null );
965+ };
966+ timer.Enabled = true;
963967 }
964968 }
965969
Show on old repository browser