Пример #1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            if (m_disposed)
            {
                return;
            }

            try
            {
                Stop();

                // Stop file monitor timer
                if ((object)m_fileProcessor != null)
                {
                    m_fileProcessor.Processing -= FileProcessor_Processing;
                    m_fileProcessor.Error      -= FileProcessor_Error;
                    m_fileProcessor.Dispose();
                    m_fileProcessor = null;
                }
            }
            finally
            {
                m_disposed = true;
            }
        }
Пример #2
0
 // Save settings on closing and dispose file watcher and file processor
 private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (Settings.Instance.FswEnabled)
     {
         Settings.Instance.ProcessClosedDate = DateTime.Now;
     }
     Settings.Instance.Save("settings.xml");
     _watcher?.Dispose();
     _processor?.Dispose();
 }
Пример #3
0
 public void CloseQueueFile()
 {
     fileProcessor.Dispose();
     log.Info("Queue File has end.");
 }