/// <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; } }
// 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(); }
public void CloseQueueFile() { fileProcessor.Dispose(); log.Info("Queue File has end."); }