Exemplo n.º 1
0
        public void WatchStop()
        {
            lock (this)
            {
                if (!IsWatching)
                {
                    return;
                }

                Watcher.Stop();
                Watcher    = null;
                IsWatching = false;
                Receiver.StopRealTimeWatching();
            }
        }
Exemplo n.º 2
0
        public void WatchStart()
        {
            // 監視中だった場合は一度監視を止める
            if (IsWatching)
            {
                WatchStop();
            }

            lock (this)
            {
                // 最初に昨日と今日のログを読み込んで必要な情報を集める
                Receiver.StopRealTimeWatching();
                TwLogWatcher.CheckWholeFile(InstDir, DateTime.Now.AddDays(-1), Receiver);
                TwLogWatcher.CheckWholeFile(InstDir, DateTime.Now, Receiver);
                Receiver.StartRealTimeWatching();

                // 監視開始
                Watcher = new TwLogWatcher(InstDir, Receiver);
                Watcher.Start();
                IsWatching = true;
            }
        }