System.Object
Eplan.EplApi.Base.Progress
System.Object
Eplan.EplApi.Base.Progress
Progress oProgress = new Progress("SimpleProgress"); oProgress.ShowImmediately(); //part 1 oProgress.BeginPart(25.0, ""); oProgress.SetActionText("part1"); oProgress.SetNeededSteps(1); oProgress.Step(1); System.Threading.Thread.Sleep(2500); // TODO: Some processing oProgress.EndPart(false); //part 2 oProgress.BeginPart(30.0, ""); oProgress.SetNeededSteps(3); // call SetNeededSteps with the count of steps following oProgress.SetActionText("part2 step1"); oProgress.Step(1); System.Threading.Thread.Sleep(1000); // TODO: Some processing oProgress.SetActionText("part2 step2"); oProgress.Step(1); System.Threading.Thread.Sleep(1000); // TODO: Some processing oProgress.SetActionText("part2 step3"); oProgress.Step(1); System.Threading.Thread.Sleep(1000); // TODO: Some processing oProgress.EndPart(false); //part 3 oProgress.BeginPart(45.0, ""); // Here is a sum of 100% reached! oProgress.SetActionText("part3"); oProgress.SetNeededSteps(1); oProgress.Step(1); System.Threading.Thread.Sleep(4500); // TODO: Some processing oProgress.EndPart(true); // The window is destroyed with the call EndPart(true) and the progress is prepared to be destroyed.
Progress progress = new Progress("SimpleProgress"); progress.SetAllowCancel(true); progress.SetAskOnCancel(true); progress.SetTitle("Replace parts"); progress.ShowImmediately(); DMObjectsFinder finder = new DMObjectsFinder(oProject); ArticleReference[] articleReferences = finder.GetArticleReferences(null); int nIteration = 0; foreach (ArticleReference articleReference in articleReferences) { // Set new values progress.BeginPart(100.0 / articleReferences.Length, "Iteration : " + (nIteration++).ToString()); articleReference.PartNr = "New part number"; articleReference.VariantNr = "New variant"; articleReference.StoreToObject(); new DeviceService().UpdateDevice(articleReference.ParentObject); progress.EndPart(); } progress.EndPart(true);
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 |