private void OnKeyDownHandler(object sender, KeyEventArgs e) { // 下がったキーがAキーの場合 if (e.Key == Key.C) { bdo_toolbox.config conf = new config(); conf.Show(); string directoryPath = BDOToolBoxStartupPath; string fileName = "config.ini"; try { // ConfigWatchDog = new FileSystemWatcher(); //監視するディレクトリを指定 ConfigWatchDog.Path = directoryPath; //最終更新日時の変更のみを監視する ConfigWatchDog.NotifyFilter = NotifyFilters.LastWrite; //CheckFile.txtを監視 ConfigWatchDog.Filter = fileName; //イベントハンドラの追加 ConfigWatchDog.Changed += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Created += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Deleted += new System.IO.FileSystemEventHandler(watcher_Changed); //監視を開始する ConfigWatchDog.EnableRaisingEvents = true; } catch { } } }
private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { string pushedKey = ""; switch (e.Key) { case Key.F1: //DebugRefresh_JPToTCN(); break; case Key.F2: case Key.F3: case Key.F4: case Key.F5: case Key.F6: case Key.F7: case Key.F8: case Key.Escape: Environment.Exit(0); break; case Key.V: Message.UnAvailable_Message(); break; case Key.D: Message.UnAvailable_Message(); break; case Key.C: bdo_toolbox.config conf = new config(); conf.Show(); string directoryPath = BDOToolBoxStartupPath; string fileName = "config.ini"; try { // ConfigWatchDog = new FileSystemWatcher(); //監視するディレクトリを指定 ConfigWatchDog.Path = directoryPath; //最終更新日時の変更のみを監視する ConfigWatchDog.NotifyFilter = NotifyFilters.LastWrite; //CheckFile.txtを監視 ConfigWatchDog.Filter = fileName; //イベントハンドラの追加 ConfigWatchDog.Changed += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Created += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Deleted += new System.IO.FileSystemEventHandler(watcher_Changed); //監視を開始する ConfigWatchDog.EnableRaisingEvents = true; } catch { } break; case Key.F11: case Key.F12: pushedKey = e.Key.ToString(); break; case Key.System: if (e.SystemKey == Key.F10) { pushedKey = "F10"; } break; } }
private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { string pushedKey = ""; switch (e.Key) { case Key.F1: DebugRefresh_JPToTCN(); break; case Key.F2: case Key.F3: case Key.F4: case Key.F5: case Key.F6: case Key.F7: case Key.F8: case Key.Escape: Environment.Exit(0); break; case Key.V: UnAvailable_Message(); break; case Key.D:UnAvailable_Message(); break; case Key.C: bdo_toolbox.config conf = new config(); conf.Show(); string directoryPath = BDOToolBoxStartupPath; string fileName = "config.ini"; try { // ConfigWatchDog = new FileSystemWatcher(); //監視するディレクトリを指定 ConfigWatchDog.Path = directoryPath; //最終更新日時の変更のみを監視する ConfigWatchDog.NotifyFilter = NotifyFilters.LastWrite; //CheckFile.txtを監視 ConfigWatchDog.Filter = fileName; //イベントハンドラの追加 ConfigWatchDog.Changed += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Created += new System.IO.FileSystemEventHandler(watcher_Changed); ConfigWatchDog.Deleted += new System.IO.FileSystemEventHandler(watcher_Changed); //監視を開始する ConfigWatchDog.EnableRaisingEvents = true; } catch { } break; case Key.F11: case Key.F12: pushedKey = e.Key.ToString(); break; case Key.System: if (e.SystemKey == Key.F10) { pushedKey = "F10"; } break; } }
private void Config_Click(object sender, RoutedEventArgs e) { bdo_toolbox.config conf = new config(); conf.Show(); StartWatchdog(); }