Пример #1
0
        private void Setup(string map, int interval)
        {
#if LOGGING
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            Log.Write("Start of the Telemetry");
            Log.Write("Set up everything and start the updatetimer");
#endif

            Map            = map;
            updateInterval = interval;

            sharedMemory = new SharedMemory();
            sharedMemory.Connect(map);

            if (!sharedMemory.Hooked)
            {
                Error = sharedMemory.HookException;
                return;
            }

            var tsInterval = new TimeSpan(0, 0, 0, 0, interval);

            updateTimer = new Timer(_updateTimer_Elapsed, null, tsInterval.Add(tsInterval), tsInterval);
#if LOGGING
            Log.Write("Every thing is set up correctly and the timer was started");
#endif
        }