Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public static void ShowProgressDialog<T>(string message, Action<T> action, T arg)
  2. {
  3.  
  4. ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel = new ESRI.ArcGIS.Display.CancelTrackerClass();
  5.  
  6. ESRI.ArcGIS.Framework.IProgressDialogFactory progressDialogFactory = new ESRI.ArcGIS.Framework.ProgressDialogFactoryClass();
  7.  
  8. // Set the properties of the Step Progressor
  9. System.Int32 int32_hWnd = ArcMap.Application.hWnd;
  10. ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = progressDialogFactory.Create(trackCancel, int32_hWnd);
  11.  
  12.  
  13. ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog2 = (ESRI.ArcGIS.Framework.IProgressDialog2)stepProgressor; // Explict Cast
  14.  
  15. progressDialog2.CancelEnabled = false;
  16. progressDialog2.Description = message;
  17. progressDialog2.Animation = ESRI.ArcGIS.Framework.esriProgressAnimationTypes.esriProgressSpiral;
  18.  
  19. action.Invoke(arg);
  20.  
  21. trackCancel = null;
  22. progressDialog2.HideDialog();
  23. progressDialog2 = null;
  24.  
  25. }
  26.  
  27. stepProgressor.Hide();
  28. progressDialog2.ShowDialog();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement