예제 #1
0
        private void DoUnrarFiles()
        {
            stopEvent.Reset();
            OnUnrarStart();
            try
            {
                foreach (var fileInfo in FileInfoList.Where(fileInfo => fileInfo.Checked))
                {
                    UnRarFile(fileInfo);
                }
            }

            /*catch (StopException)
             * {
             *  //ex.ToString();
             *  // do nothing, it's normal
             * }*/
            /*catch
             * {
             *  //if (stopEvent.WaitOne(0)) ;
             *  //ex.ToString();
             *  // do nothing, it's normal
             * }*/
            finally
            {
                OnUnrarComplete();
            }
        }
예제 #2
0
 private void DoDownloadFiles()
 {
     if (OnDownloadStart != null)
     {
         OnDownloadStart();
     }
     try
     {
         stopEvent.Reset();
         foreach (var fi in FileInfoList.Where(fi => fi.Checked))
         {
             DownloadFile(fi);
         }
     }
     catch (StopException ex)
     {
         ex.ToString();// do nothing, it's normal
     }
     finally
     {
         if (OnDownloadComplete != null)
         {
             OnDownloadComplete();
         }
     }
 }
예제 #3
0
        // プロセスの終了を捕捉する Exited イベントハンドラ
        private void Process_Exited(object sender, EventArgs e)
        {
            var proc = (System.Diagnostics.Process)sender;

            var process = DisplayFileInfoList.Where(x => x?.Process?.Id == proc?.Id);

            if (process.Any())
            {
                foreach (var item in process)
                {
                    item.Process    = null;
                    item.Processing = false;
                }
            }
            process = FileInfoList.Where(x => x?.Process?.Id == proc?.Id);
            if (!process.Any())
            {
                return;
            }
            foreach (var item in process)
            {
                item.Process    = null;
                item.Processing = false;
            }
        }
예제 #4
0
 private void DoUpdate()
 {
     stopEvent.Reset();
     if (OnUpdateStart != null)
     {
         OnUpdateStart();
     }
     try
     {
         dbCache.RebuildCache();
         //var databaseMap = FiasDatabaseMap.LoadFromFile(RootFolder + "\\Fias.Mapping.xml");
         foreach (var fInfo in from date in FileInfoList.Select(a => a.Description).Distinct() from fInfo in FileInfoList.Where(a => (a.Description == date) && (a.Url == string.Empty) && (a.Checked)).OrderBy(a => a.Length) where !stopEvent.WaitOne(0) select fInfo)
         {
             ProcessXmlFile(fInfo);
         }
     }
     catch (StopException ex)
     {
         ex.ToString();// do nothing, it's normal
     }
     finally
     {
         if (OnUpdateComplete != null)
         {
             OnUpdateComplete();
         }
     }
 }