Ejemplo n.º 1
0
 /// <summary>
 ///   The run method of the thread on which the <see cref="SevenZipExtractor" /> is created.
 /// </summary>
 /// <remarks>
 ///   This method creates a <see cref="SevenZipExtractor" /> and then watches for events to execute.
 ///   Other methods signal the thread that an action needs to be taken, and this thread executes said
 ///   actions.
 /// </remarks>
 protected void RunThread()
 {
     Extractor = String.IsNullOrEmpty(m_strPath)
 ? new SevenZipExtractor(m_stmArchive)
 : new SevenZipExtractor(m_strPath);
     try
     {
         var kvpStartEvent = m_queEvents.Dequeue();
         kvpStartEvent.Value.Set();
         while (true)
         {
             m_mreEvent.WaitOne();
             var kvpEvent = m_queEvents.Dequeue();
             if (kvpEvent.Key == null)
             {
                 break;
             }
             kvpEvent.Key(null);
             m_mreEvent.Reset();
             kvpEvent.Value.Set();
         }
     }
     finally
     {
         Extractor.Dispose();
     }
 }
Ejemplo n.º 2
0
            public override void Dispose()
            {
                if (pdfExtractor != null)
                {
                    pdfExtractor.Dispose();
                }

                if (pdfDocument != null)
                {
                    pdfDocument.Dispose();
                }
            }
Ejemplo n.º 3
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     extractor.Dispose();
 }