Пример #1
0
 private void btnFaultDelete_Click(object sender, EventArgs e)
 {
     try
     {
         btnFault.Enabled = false;
         SWX.SWX_Connector.GetApp();
         SWX.Settings.Run = true;
         SWX.ExportDrawings Exp = new SWX.ExportDrawings();
         Exp.GetFile(true);
         SWX.Settings.Run = false;
         btnFault.Enabled = true;
         lblStatus.Text   = "Fehlersuche abgeschlossen";
     }
     catch (Exception ex)
     {
         KKS.KKS_Message.Show(ex.Message);
     }
 }
Пример #2
0
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                SWX.SWX_Connector.GetApp();
                SWX.ExportDrawings Exp = new SWX.ExportDrawings();
                Exp.OverrideMsg();
                if (!Exp.GetFile())
                {
                    return;
                }

                //Check if Run OK
                if (bgWorker.CancellationPending || SWX.Settings.Run == false)
                {
                    RunCancel(ref e); return;
                }
                else
                {
                    bgWorker.ReportProgress(3);
                }

                Exp.GetParts(SWX.SWX_Connector.iComponent);

                //Check if Run OK
                if (bgWorker.CancellationPending || SWX.Settings.Run == false)
                {
                    RunCancel(ref e); return;
                }
                else
                {
                    bgWorker.ReportProgress(10);
                }

                if (!Exp.CheckDrawingRelease())
                {
                    RunCancel(ref e); return;
                }

                //Berechnung der einzelnen Schritte der Progressbar
                decimal Procent = 80 / Exp.Parts.Count;

                for (int x = 0; x < Exp.Parts.Count; x++)
                {
                    bgWorker.ReportProgress(25 + (int)Math.Round(x * Procent, 0));
                    Exp.GetDrawing(Exp.Parts[x]);

                    if (bgWorker.CancellationPending || SWX.Settings.Run == false)
                    {
                        RunCancel(ref e); return;
                    }
                }
                return;
            }

            catch (Exception ex)
            {
                KKS.KKS_Message.Show(ex.Message);
                return;
            }
        }