예제 #1
0
 public static void Execute(string title, Action <Action <long>, Action <long> > action, UiProgressUnits units = UiProgressUnits.Items)
 {
     using (UiProgressWindow window = new UiProgressWindow(title, units))
     {
         Task.Run(() => ExecuteAction(window, action));
         window.ShowDialog();
     }
 }
예제 #2
0
 public static T Execute <T>(string title, Func <Action <long>, Action <long>, T> action, UiProgressUnits units = UiProgressUnits.Items)
 {
     using (UiProgressWindow window = new UiProgressWindow(title, units))
     {
         Task <T> task = Task.Run(() => ExecuteFunction(window, action));
         window.ShowDialog();
         return(task.Result);
     }
 }
예제 #3
0
 public static void Execute(string title, IProgressSender progressSender, Action action, UiProgressUnits units = UiProgressUnits.Items)
 {
     using (UiProgressWindow window = new UiProgressWindow(title, units))
     {
         progressSender.ProgressTotalChanged += window.SetTotal;
         progressSender.ProgressIncremented  += window.Incremented;
         Task.Run(() => ExecuteAction(window, action));
         window.ShowDialog();
     }
 }
예제 #4
0
 public static T Execute <T>(string title, IProgressSender progressSender, Func <T> func, UiProgressUnits units = UiProgressUnits.Items)
 {
     using (UiProgressWindow window = new UiProgressWindow(title, units))
     {
         progressSender.ProgressTotalChanged += window.SetTotal;
         progressSender.ProgressIncremented  += window.Incremented;
         Task <T> task = Task.Run(() => ExecuteFunction(window, func));
         window.ShowDialog();
         return(task.Result);
     }
 }