System.Object
Eplan.EplApi.Base.Progress
System.Object
Eplan.EplApi.Base.Progress
using (var progress = new Progress("SimpleProgress")) { progress.ShowImmediately(); //part 1 progress.BeginPart(25.0, ""); progress.SetActionText("part1"); progress.SetNeededSteps(1); progress.Step(1); System.Threading.Thread.Sleep(2500); // Add some processing here progress.EndPart(false); //part 2 progress.BeginPart(30.0, ""); progress.SetNeededSteps(3); // Call SetNeededSteps with the count of steps following progress.SetActionText("part2 step1"); progress.Step(1); System.Threading.Thread.Sleep(1000); // Add some processing here progress.SetActionText("part2 step2"); progress.Step(1); System.Threading.Thread.Sleep(1000); // Add some processing here progress.SetActionText("part2 step3"); progress.Step(1); System.Threading.Thread.Sleep(1000); // Add some processing here progress.EndPart(false); //part 3 progress.BeginPart(45.0, ""); // Here is a sum of 100% reached! progress.SetActionText("part3"); progress.SetNeededSteps(1); progress.Step(1); System.Threading.Thread.Sleep(4500); // Add some processing here progress.EndPart(true); }
using (var progress = new Progress("SimpleProgress")) { progress.SetAllowCancel(true); progress.SetAskOnCancel(true); progress.SetTitle("Replace parts"); progress.ShowImmediately(); var finder = new DMObjectsFinder(oProject); var articleReferences = finder.GetArticleReferences(null); var nIteration = 0; var progressPartInPercentage = 100.0 / articleReferences.Length; foreach (var articleReference in articleReferences) { // Set new values progress.BeginPart(progressPartInPercentage, $"Iteration : {nIteration++}"); articleReference.PartNr = "New part number"; articleReference.VariantNr = "New variant"; articleReference.StoreToObject(); new DeviceService().UpdateDevice(articleReference.ParentObject); progress.EndPart(); } }
| Name | Description | |
|---|---|---|
![]() | Progress Constructor | Overloaded. |
| Name | Description | |
|---|---|---|
![]() | BeginPart | Starts a new segment. All parallel segments should result in a sum of 100%. |
![]() | Canceled | Queries whether the operation was canceled. |
![]() | Dispose | Destructor for deterministic finalization of Progress object. |
![]() | EndPart | Overloaded. Ends segment and closes the window when it is not used. Don't forget to call it at the end, otherwise a progress dialog may lock P8. |
![]() | GetProgress | For internal use only. |
![]() | SetActionText | Sets a new action text. |
![]() | SetAllowCancel | Allows canceling. |
![]() | SetAskOnCancel | Asks to confirm the cancel request. |
![]() | SetNeededParts | Specifies how many segments are required. |
![]() | SetNeededSteps | Indicates how many steps are required to reach 100%. E.g. used for loops. |
![]() | SetOverallActionText | Sets a new action text. |
![]() | SetTitle | Sets the title of the progress bar. |
![]() | ShowImmediately | Shows the progress bar without any further delay. When ShowImmediately isnt't called the dialog appears later (with delay), it prevents the dialog to show unnecessarily (to prevent that the progress flickers up for a short running actions). |
![]() | ShowLevel | Specifies the nesting level up to which a display is made. |
![]() | Step | Uses a step |