コード例 #1
0
ファイル: Program.cs プロジェクト: DeanLee77/LogMonitor
        static void Main(string[] args)
        {
            string configFilePath = @"C:\Windows\Temp\config\watcher.config";

            WatcherCore watcher = new WatcherCore(configFilePath);

            watcher.Monitoring();
        }
コード例 #2
0
        /*********
        ** Public methods
        *********/
        /// <summary>Update the tracked values.</summary>
        /// <param name="watchers">The watchers to snapshot.</param>
        public void Update(WatcherCore watchers)
        {
            // update player instance
            if (watchers.CurrentPlayerTracker == null)
            {
                this.CurrentPlayer = null;
            }
            else if (watchers.CurrentPlayerTracker.Player != this.CurrentPlayer?.Player)
            {
                this.CurrentPlayer = new PlayerSnapshot(watchers.CurrentPlayerTracker.Player);
            }

            // update snapshots
            this.WindowSize.Update(watchers.WindowSizeWatcher);
            this.Locale.Update(watchers.LocaleWatcher);
            this.CurrentPlayer?.Update(watchers.CurrentPlayerTracker);
            this.Time.Update(watchers.TimeWatcher);
            this.SaveID.Update(watchers.SaveIdWatcher);
            this.Locations.Update(watchers.LocationsWatcher);
            this.ActiveMenu.Update(watchers.ActiveMenuWatcher);
            this.Cursor.Update(watchers.CursorWatcher);
            this.MouseWheelScroll.Update(watchers.MouseWheelScrollWatcher);
        }