예제 #1
0
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            // Stop Watchfolder
            _imageWatchFolder?.Stop();

            _context = (ManagerContext)DataContext;

            _running = false;
            lock (_synLock1)
            {
                Monitor.PulseAll(_synLock1);
            }
            _context.Dispose();
            try
            {
                _context.SerializeToFile();
            }
            catch (Exception ex)
            {
                using (EventLog eventLog = new EventLog("Application"))
                {
                    eventLog.Source = "Application";
                    eventLog.WriteEntry($"EIS ContentManager was unable to store the configuration to file.\n{ex.Message}\n\n{ex.StackTrace}",
                                        EventLogEntryType.Error, 101, 1);
                }
            }
        }
예제 #2
0
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            // Stop Watchfolder
            _imageWatchFolder.Start();

            _context = (ManagerContext)DataContext;

            _running = false;
            lock (_synLock)
            {
                Monitor.PulseAll(_synLock);
            }
            _context.Dispose();
            _context.SerializeToFile();
        }