示例#1
0
 private void DeCompressButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (SelectedItemList != null)
         {
             string startPath = Path.Combine(ListFiles.varListPath, SelectedItemList.Name);
             if (Path.GetExtension(startPath).ToUpper() == ".ZIP")
             {
                 try
                 {
                     string decompPath = Path.Combine(ListFiles.varListPath, Path.GetFileNameWithoutExtension(SelectedItemList.Name));
                     //Directory.CreateDirectory(decompPath);
                     ZipFile.ExtractToDirectory(startPath, decompPath);
                     ListFiles.OutDirAndFiles(RightListFile, ListFiles.varListPath);
                 }
                 catch (System.IO.IOException)
                 {
                     MessageBoxResult res = MessageBox.Show("Файл уже существует. Заменить файл?", "Предупреждение", MessageBoxButton.YesNo);
                     if (res == MessageBoxResult.Yes)
                     {
                         string decompPath = Path.Combine(ListFiles.varListPath, Path.GetFileNameWithoutExtension(SelectedItemList.Name));
                         Directory.Delete(decompPath, true);
                         ZipFile.ExtractToDirectory(startPath, decompPath);
                     }
                     else
                     {
                         return;
                     }
                 }
             }
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка"); }
 }
示例#2
0
 void checkThread(Thread thread)
 {
     while (thread.IsAlive)
     {
     }
     LoadScreenStop();
     Dispatcher.Invoke(() => ListFiles.OutDirAndFiles(RightListFile, ListFiles.varListPath));
 }
示例#3
0
        void checkHashThread(Thread thread, string file)
        {
            while (thread.IsAlive)
            {
            }
            LoadScreenStop();
            Dispatcher.Invoke(() => ListFiles.OutDirAndFiles(RightListFile, ListFiles.varListPath));
            hashWin hw = null;

            Dispatcher.Invoke(() => hw = new hashWin(file, hash));
            Dispatcher.Invoke(() => hw.Show());
        }
示例#4
0
 private void RightSearchDirButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (RightSearchDirText.Text != null && RightSearchDirText.Text != "")
         {
             ListFiles.OutDirAndFiles(RightListFile, RightSearchDirText.Text);
         }
         else
         {
             MainWindow mainWindow = new MainWindow();
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }