Add Utils.RunBackground
This commit is contained in:
		| @@ -46,6 +46,16 @@ namespace WGneu { | ||||
|             return a.Select(ch => ch - '0').Aggregate((sum, n) => (sum * 10 + n) % b); | ||||
|         } | ||||
|  | ||||
|         public static void RunBackground(string title, Func<Task> a) { | ||||
|             Task.Run(async () => { | ||||
|                 try { | ||||
|                     await a(); | ||||
|                 } catch (Exception e) { | ||||
|                     MessageBox.Show(e.ToString(), title, MessageBoxButton.OK, MessageBoxImage.Error); | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         public sealed class TemporaryFile : IDisposable { | ||||
|             private int Usages = 0; | ||||
|             public string FilePath { get; private set; } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user