Пример #1
0
 private void buttonExt_Click(object sender, RoutedEventArgs e)
 {
     if (lvGRFItems.SelectedItems.Count > 0)
     {
         System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
         System.Windows.Forms.DialogResult        dr  = fbd.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             epd = new ExtractProgressDialog(lvGRFItems.SelectedItems.Count);
             List <GRFFile> grfExtractList = new List <GRFFile>();
             this.Dispatcher.Invoke(new ThreadStart(() =>
             {
                 foreach (GRFFile file in lvGRFItems.SelectedItems)
                 {
                     grfExtractList.Add(file);
                 }
             }));
             Thread et = new Thread(new ParameterizedThreadStart(delegate
             {
                 foreach (GRFFile file in grfExtractList)
                 {
                     baseGRF.ExtractFileToPath(file, fbd.SelectedPath + "/");
                 }
             }));
             et.Start();
             epd.ShowDialog();
             et.Abort();
         }
     }
 }
Пример #2
0
 private void buttonExtAll_Click(object sender, RoutedEventArgs e)
 {
     if (baseGRF.IsOpen)
     {
         System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
         System.Windows.Forms.DialogResult        dr  = fbd.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             epd = new ExtractProgressDialog(baseGRF.FileCount);
             Thread et = new Thread(new ThreadStart(delegate
             {
                 foreach (GRFFile file in baseGRF.Files)
                 {
                     baseGRF.ExtractFileToPath(file, fbd.SelectedPath + "/");
                 }
             }));
             et.Start();
             epd.ShowDialog();
             et.Abort();
         }
     }
 }
Пример #3
0
 private void buttonExt_Click(object sender, RoutedEventArgs e)
 {
     if (lvGRFItems.SelectedItems.Count > 0)
     {
         System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
         System.Windows.Forms.DialogResult dr = fbd.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             epd = new ExtractProgressDialog(lvGRFItems.SelectedItems.Count);
             List<GRFFile> grfExtractList = new List<GRFFile>();
             this.Dispatcher.Invoke(new ThreadStart(() =>
             {
                 foreach (GRFFile file in lvGRFItems.SelectedItems)
                 {
                     grfExtractList.Add(file);
                 }
             }));
             Thread et = new Thread(new ParameterizedThreadStart(delegate
             {
                 foreach (GRFFile file in grfExtractList)
                 {
                     baseGRF.ExtractFileToPath(file, fbd.SelectedPath + "/");
                 }
             }));
             et.Start();
             epd.ShowDialog();
             et.Abort();
         }
     }
 }
Пример #4
0
 private void buttonExtAll_Click(object sender, RoutedEventArgs e)
 {
     if (baseGRF.IsOpen)
     {
         System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
         System.Windows.Forms.DialogResult dr = fbd.ShowDialog();
         if (dr == System.Windows.Forms.DialogResult.OK)
         {
             epd = new ExtractProgressDialog(baseGRF.FileCount);
             Thread et = new Thread(new ThreadStart(delegate
             {
                 foreach (GRFFile file in baseGRF.Files)
                 {
                     baseGRF.ExtractFileToPath(file, fbd.SelectedPath + "/");
                 }
             }));
             et.Start();
             epd.ShowDialog();
             et.Abort();
         }
     }
 }